javascript - Move element created to textarea -
i link 2 scripts send result of first clipboard, using second script. both work separately thank you, sorry if not clear.
<html> <body> <p>click button create h1 element text.</p> <button onclick="myfunction()">try it</button> <script> function myfunction() { var h = document.createelement("h1"); var t = document.createtextnode("it works"); h.appendchild(t); document.body.appendchild(h); } </script> <script type="text/javascript" src="zeroclipboard.js"> </script> <textarea name="box-content" id="box-content" rows="10" cols="70"> copied clipboard. line2. line3. </textarea> <br /><br />
simply changing .value
of textarea:
document.getelementbyid('box-content').value = "it works";
Comments
Post a Comment