I do not know how to solve this. I want to change the source code (DOM) to some kind of event, for example:
script:
<script type="text/javascript">
function ChangeText(){
document.getElementById("p1").innerHTML="New text!";
}
</script>
HTML:
<p id="p1">Hello world!</p>
<input type="button" onclick="ChangeText()" value="Change text" />
Ok, this works great when I click the button. but when I look through the source code. it still looks like this:
<html>
<body>
<p id="p1">Hello world!</p>
<input type="button" onclick="ChangeText()" value="Change text" />
</body>
</html>
instead:
<html>
<body>
<p id="p1">New text!</p>
<input type="button" onclick="ChangeText()" value="Change text" />
</body>
</html>
source
share