Prev Demo
JavaScript
>
Lastindexof() Method
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button for searching the character of a string</p> <input type="button" value="Search" onclick="Function()" /> <p id="myId"></p> <script> function Function() { var a = "Visit TechFunda, learn in TechFunda."; var r = a.lastIndexOf("TechFunda"); document.getElementById("myId").innerHTML = r; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output