I currently have my class element:
var frame_2 = document.querySelectorAll(".name");
Currently this div is empty. I now want to "append/add" some content to that div - I had a go with innerHTML
+ innerText
but for some reason nothing seems to be added.
Example:
frame_2.innerHTML = '<img src="image.gif" />';
and
frame_2.innerText = 'some text';
Any suggestions? Im not sure if there are ways of doing the same - or performance'wise something better?
this gives you a list of elements that contain the class name
you want the first element?
This gives you one single element, the first one.
To append stuff
EDIT
To get the elements by classname, then retrieve the id :
or if i didn't understand correctly
html
js
EDIT2
html
js