This one works:
-
document.getElementByClassName('whatever') returns array of html object elements inside the document,
so you need
var ele = document.getElementsByClassName('textbox');
ele[0].innerHTML = "Whatever text" ;
If you want to set inner html to all the elements of this class
you can use
for(var i=0;i
- 热议问题