Search

Saturday, September 13, 2008

javascript search string


<html>
<body>

<script type="text/javascript">

var str="Hello world!";

document.write(str.search("world") + "
");
document.write(str.search("World") + "
");
document.write(str.search("woorld") + "
");

</script>

</body>
</html>




If string for search certain in source in search string it return index of position

No comments: