Input Your Text Here:
Start:
End:
Source Code:
<html>
<head><title>Use of Slice() function!</title>
<script language="javascript">
function slicetxt() {
txtdisp.value=txtslice.value.slice(start1.value,end1.value);
}
</script>
</head>
<body>
Input Your Text Here: <input type="text" name="txtslice"><br>
Start:
<select name="start1">
<option value="-4">-4
<option value="-3">-3
<option value="-2">-2
<option value="-1">-1
<option value="0">0
<option value="1">1
<option value="2">2
<option value="3">3
<option value="4">4
</select> <br>
End:
<select name="end1">
<option value="-4">-4
<option value="-3">-3
<option value="-2">-2
<option value="-1">-1
<option value="0">0
<option value="1">1
<option value="2">2
<option value="3">3
<option value="4">4
</select>
<input type="button" name="bttnslice" value="Slice" Onclick="slicetxt()">
<input type="text" name="txtdisp" >
</body>
</html>
No comments:
Post a Comment