Javascript examples for DOM HTML Element:Paragraph
copy content from a <p> element to hidden <input> element?
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> function myFunction() {/* w w w . j a v a 2s. co m*/ document.getElementById("output").value = document.getElementById("input").innerHTML; } </script> </head> <body> <p id="input" contenteditable="true" onkeyup="myFunction()">This is a paragraph. </p> <input type="text" id="output"> </body> </html>