<html>
<head>
<script language="javascript">
function reverse()
{
var str=document.getElementById("input").value;
var a=str.split('');
var result=new Array();
while(a.length)
{
result.push(a.pop());
}
document.getElementById("result").innerHTML=result.join('');
}
</script>
<title>javascript</title>
</head>
<body>
<table>
<tr>
<td><input type="textfield" id="input"/>=></td>
<td><div id="result"></div></td>
</tr>
</table>
<input type="button" value="reverse" onclick="reverse()"/>
</body>
</html>
<head>
<script language="javascript">
function reverse()
{
var str=document.getElementById("input").value;
var a=str.split('');
var result=new Array();
while(a.length)
{
result.push(a.pop());
}
document.getElementById("result").innerHTML=result.join('');
}
</script>
<title>javascript</title>
</head>
<body>
<table>
<tr>
<td><input type="textfield" id="input"/>=></td>
<td><div id="result"></div></td>
</tr>
</table>
<input type="button" value="reverse" onclick="reverse()"/>
</body>
</html>