Jump to content

Can't get the value in a textbox


Sami

Recommended Posts

<!DOCTYPE html><html><head><title></title></head><body><div><button onclick="alert(document.getElementById('input').innerHTML);">Alert</button></div><textarea id="input" onchange="document.getElementById('display').innerHTML=this.innerHTML;" onkeyup="document.getElementById('display').innerHTML=this.innerHTML;" style="display:block;width:100%;"></textarea><div id="display" style="border:solid 1px black;">The HTML is supposed to appear here.</div></body></html>

It works in IE(Tab), but when I try it in Firefox and Opera, guess what...Firefox:tht.jpgIE(Tab):tht2.png

Link to comment
Share on other sites

<!DOCTYPE html><html><head><title></title></head><body><div><button onclick="alert(document.getElementById('input').value);">Alert</button></div><textarea id="input" onchange="document.getElementById('display').innerHTML=this.value;" onkeyup="document.getElementById('display').innerHTML=this.innerHTML;" style="display:block;width:100%;"></textarea><div id="display" style="border:solid 1px black;">The HTML is supposed to appear here.</div></body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...