Home>
I want to achieve

I wrote on the website that I can get an error when I click the button with the required attribute of the input element, but for some reason it doesn't show up in my file. Please tell me the difference. I will post the website for the time being. https://techacademy.jp/magazine/23857
Also, does this need to be enclosed in a form?

Corresponding source code

First of all, the one on the website where the error is displayed properly

<form action =''>
<input type ='text' required>
<input type ='text' required>
<input type = "submit" value = "submit">
</form>


And those who can't do it (I'm using number because I want to limit the number)

<form action =''>
<input type = "number" required>
<input type = "number" required>
<input type = "button" value = "SEARCH">
</form>
Supplementary information

Since Google Chrome is used for display, I don't think there are any browsers that do not support it.

  • Answer # 1

    I think required may or may not work depending on the browser
    I think that there is a form because it is activated by submitting the form
    I'm sorry if it's different. .. ..