I need to find/get a class called "group" from a div-tag, with javascript. after that i want to insert a html button(input=submit) inside that div i just found.
How can this be done with javascript ?
i've tryed this so far, but gets and error: document is not declared!
var myMessage = 'Mange tak';
var html_kode = '<input type="submit" onclick="clickedelm = this.value" id="qr_tak" tabindex="1" name="sbutton" title="(Alt + A)" accesskey="a" value="Auto Tak" class="button">';
if(myMessage) {
var find_class = document.getElementsByClassName('group');
if (find_class) {
find_class.innerHTML += html_kode;
}
}
documentnot defined hints for something very wrong with your code. That code is placed in a real HTML page? Doctype compliant?