Javascript examples for String:Quiz
Display the position of the first occurrence of "World" in the variable txt.
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var txt = "Hello World"; document.getElementById("demo").innerHTML = txt.indexOf("World"); </script>//from ww w. j av a2s. c om </body> </html>