Thursday, August 15, 2013

javascript index Of method

<html>
<body>

<script type="text/javascript">
var str="Hello world!";
document.write(str.indexOf("Hello") + "<br />");
document.write(str.indexOf("WORLD") + "<br />");
document.write(str.indexOf("world"));
</script>

</body>
</html>

result


No comments: