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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -