0
Id attribute html
I have a problem with the Id tag pls help me. I don't understand it.
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;