This page has code written in case the browser does not have JavaScript functioning. There is a "noscript" tag, <noscript>.
The following will demonstrate the use of the indexOf() function to specify the position of a character
phrase, or word in a string. The position's place, more specifically its number, is returned.
<script type="text/javascript"> var str="Hello world!"; document.write(str.indexOf("d") + "<br />"); document.write(str.indexOf("WORLD") + "<br />"); document.write(str.indexOf("e")); </script>
The following will demonstrate the use of the JavaScript special character /" to produce a quotation mark,
otherwise the string will be chopped and/or an error will be reported.
<script type="text/javascript"> document.write ("<p>") var txt="We are the so-called /"Hens/" from the east coast."; document.write(txt); document.write ("</p>") </script>
Return to Table of Contents