html - How JavaScript's Dom manipulation changes the text content of child elements
某草草
某草草 2017-05-24 11:36:57
0
2
755

Why can't the following code change "Hello" in the p tag to "Hello everyone"?

某草草
某草草

reply all(2)
为情所困

getElementsByTagName The function returns a DOM collection:

cont[0].innerHTML = 'Hello'
黄舟

getElementById returns a value, while getElementsByName returns a collection.
id is unique, name can be the same.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template