First of all, a textarea and a text input are two different things. I will assume that you mean a text input:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function xFerText(el, id){
document.getElementById(id).firstChild.nodeValue=el.value;
}
</script>
</head>
<body>
<input type="text" onchange="xFerText(this, 'output');" onkeyup="xFerText(this, 'output');">
<div id="output"> </div>
</body>
</html>
Or:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function xFerText(id1, id2){
document.getElementById(id2).firstChild.nodeValue=document.getElementById(id1).value;
}
</script>
</head>
<body>
<input id="input" type="text">
<div id="output"> </div>
<input type="button" value="Go" onclick="xFerText('input', 'output');">
</body>
</html>
Bookmarks