Why can't the following code change "Hello" in the p tag to "Hello everyone"?
为情所困2017-05-24 11:38:57
getElementsByTagName
The function returns a DOM collection:
cont[0].innerHTML = 'Hello'
黄舟2017-05-24 11:38:57
getElementById returns a value, while getElementsByName returns a collection.
id is unique, name can be the same.