Tuesday, February 14, 2017

innerHTML into textarea?



codea

<textarea id="atnbg20170214tu1059" style="height: 100px; width: 400px;"></textarea>

<div id="atnbg20170214tu1059test"><a href="javascript:atnbg20170214tu1059()" style="color: greenyellow; font-size: 1.5em;">
can I put the inner HTML of an element into a textarea?</a></div>

<script> 

function atnbg20170214tu1059() {

var textarea = document.getElementById("atnbg20170214tu1059") 

textarea.value = document.getElementById("atnbg20170214tu1059test").innerHTML}

</script>a
code