Forum Moderators: open
I'm building a form that just takes in text. As users insert text into the text-boxes, I'd like to immediately show them their text in html.
What I'm doing is like in Google Adwords when you type your advertisement, every letter you type immediately shows up in a preview of your advertisement right next to it.
How would I do this? I can't find any scripts to point me in the right direction.
thanks!
<script type="text/javascript">
function copyWords(obj){
document.getElementById("copiedText").value = obj.value; /*** copies input value to another form input ***/
document.getElementById("two").innerHTML = obj.value; /*** copies input value to a non-input html element using innerHTML ***/
}
</script>
<form action="">
<p><input type="text" size="50" onkeyup="copyWords(this);" />
<input id="copiedText" type="text" size="50" readonly="readonly" /></p>
</form>
<p id="two"></p>