Headline!
gets the name “as HTML": all tags become tags, so we see the bold name.
2 The second
gets the name “as text”, so we literally see Winnie-the-Pooh!
In most cases, we expect the text from a user, and want to treat it as text. We don't want unexpected HTML in our
site. An assignment to textContent does exactly that.
The “
The *hidden' attribute and the DOM property specifies whether the element is visible or not.
\den” property
‘We can use it in HTML or assign it using JavaScript, like this:
With the attribute "hidden"
JavaScript assigned the property "hidden"
Technically, hidden works the same as style="display:none” . But it’s shorter to write
Here's a blinking element
A blinking element
felem.hidden, 1000);More properties
DOM elements also have additional properties, in particular those that depend on the class:
+ value -the value for ,