What is this "checked id" attribute inside the <input> tag? Normally it is "id" attribute

2771 views html

I am looking at the sourcecode of a website, and come across the following code snippets

<input type="checkbox" name="age" value="1" checked id="age"><label for="age">I am an adult and capable citizen</label>

what is the attribute "checked id" as oppose to the "id" attribute that we normally see inside the tag, thanks.

answered question

checked is an attribute you place to make a checkbox 'ticked' by default. id is a different attribute, which means the id of the element is named 'age'. no such thing as "checked id". take the word checked and place it just before the closing > of your input. same effect, but readable.

Hi Stavm, thanks for your help, cheers. :)

1 Answer


All fine, look at it closely. input type="checkbox", so it may have "checked"

posted this

Have an answer?


Please login first before posting an answer.