Solution:
<HTML>
<script>
function find()
{
var str=frm.txt1.value;
37
var n = str.length;
alert("length of string is: "+n);
}
</script>
<form name="frm">
Enter a String:<input name="txt1" type="text" />
<input name="b1" onclick="find();" type="button" value="display" /></form>
</BODY>
</HTML>
0 Comments