javascript innerhtml
document.getElementById("example").innerHTML = "Paragraph changed!";
javascript innerhtml
document.getElementById("example").innerHTML = "Paragraph changed!";
js innerHTML
document.getElementById("Test").innerHTML = "<p style='color:red;'>Test</p>";
execute js with innerhtml
<html>
<head>
<script>
function executer_script(monscript) {
var head = document.getElementsByTagName("head")[0];
var scr;
var d = document.getElementById('resultat');
d.innerHTML = monscript;
var scrajx = d.getElementsByTagName('script');
for(var i in scrajx) {
scr = document.createElement("script");
scr.type = "text/javascript";
scr.text = scrajx[i].text;
head.appendChild(scr);
}
}
</script>
</head>
<body>
<input type="button" value="test" onclick="executer_script('Mon html + du javascript <script>alert(\'test\');</script>');">
<div id="resultat"></div>
</body>
</html>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us