I have a weird html problem.
I have a code like:
<label for="username">Username</label>
<input name="username" type="text"/>
But when I click on the label text Username I am not "redirected" into the input text field. By redirection I mean that the blinking cursor appears inside the input field and I can start writing.
What am I doing wrong?
The disabled Attribute The value of a disabled input field will not be sent when submitting the form!
The required attribute is a boolean attribute. When present, it specifies that an input field must be filled out before submitting the form. Note: The required attribute works with the following input types: text, search, url, tel, email, password, date pickers, number, checkbox, radio, and file.
1. Which of the following is not a type of attribute for input tag? Explanation: Day is not defined in the pre-defined attribute list of input tag. Week attribute defines week and year when used as attribute in input tag.
The autocomplete attribute is used to enable and disable autocompletion of text. This attribute contains two values: on. off.
For in label refers to an id:
<label for="username">Username</label>
<input name="username" id="username" type="text"/>
More: http://www.w3.org/TR/html401/interact/forms.html#h-17.9.1
The text box also needs a value for id, so use one in the text box like this:
<input name="username" id="username" type="text"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With