0
change HTML content with JS function
Hello, I am having troubles setting HTML with JS function. The code below is supposed to alter the content of the Paragraph. I am using separate html and js files. <div onchange="funct_1();"> <p id="here_1">Value</p> </div> function funct_1(){ document.getElementById("here_1").innerHTML="done"; return; }
6 Respostas
+ 1
@FF9900: I tried but didn't succeed until I used window.onchange within JS. Thank you for your suggestions, highly appreciated!
+ 1
I think, you're trying to automate things....
Try this.....
$('.classname or #id of div').bind('DOMSubtreeModified', function() {
document.getElementById('here_1').innerHTML = "done";
});
0
had this thought at first as well. Maybe I need a different event. even tried onmouseover
is <p> not changeable?