Prev Demo
JavaScript
>
Search() Method
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>Searching a string.</h1> <p>Click the below button to search.</p> <input type="button" value="Search" onclick="Function()" /> <p id="myId"></p> <script> function Function() { var A = "This is DotNetFunda"; var r = A.search("DotNetFunda"); document.getElementById("myId").innerHTML = r; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output