Here is my HTML code:
<!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-1.7.2.js"></script> </head> <body> <input id="test" value=""> <input type="button" id="btn" value="Get"> </body> </html>
And JS:
$('#btn').click(function(){ alert(document.documentElement.innerHTML); });
http://jsbin.com/wuveresele/edit?html,js,output
I want to enter some value (for example, 123) in the input field, click the button and see the โvisualizedโ html-code of the page in the warning pop-up window.
What I see:
... <input id="test" value=""> ...
What I want to see:
... <input id="test" value="123"> ...
Is it possible to use JS or jQuery?
source share