Jump to content

Why is it giving open tag through body.innerHTML


Rachit Shah

Recommended Posts

When I am using document.body.innerHTML, I am getting<input type="button" onclick="writeIt()" value="Write">I dont know where the / has gone.Do anyone know How can I retrieve exact source line.(i.e with / in the tag source)

<html><head><script id='script1' name='script1' type="text/javascript">function writeIt () {var x= "<script>" + window.document.scripts(0).text;x = x + "</script";x = x + ">";alert(x);alert(document.body.innerHTML);}</script></head><body><input type="button" onclick="writeIt()" value="Write"/></body></html>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...