this is my code :
<!DOCTYPE html>
<html>
<head>
<p id="x"></p>
<p id="y"></p>
<style>
</style>
</head>
<body>
<button id="btn">Click Me!</button>
<script src="jquery/jquery1.12.js"></script>
<script>
var txt = '<!DOCTYPE html>\
<html>\
<head>\
</head>\
<body>\
<script>\
alert("ok");\
</script>\
</body>\
</html>';
$(document).ready(function(){
$("#btn").click(function(){
$("#x").text(txt);
})
})
</script>
</body>
</html>
How do I display the code as plain text.i want each line variable x go to new line for example :
output as :
<!DOCTYPE html>
<html>
<head>
up to the end
any help,tankyou.