0

Id attribute html

I have a problem with the Id tag pls help me. I don't understand it.

11th Jun 2025, 12:58 PM
Haleemah AbdulRahman Ayomide
Haleemah AbdulRahman Ayomide - avatar
2 Réponses
0
Id is not a tag. It is an attribute which should be unique across the html. Id is used to access elements value like input fields or a tag value. For example: to get input fields value ------- let name = document.getElementById('name').value; to get tags value ---------- let tagValue = document.getElementById('tag').innerHTML;
18th Jun 2025, 3:12 AM
A͢J
A͢J - avatar