Prev Demo
Charat Method For Returning The First Character
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>charAt() method for returning first character</h1> <p>Click on the "Button" for returning the 1st character from the start of a string "SN ITFunda Service LLP".</p> <input type="button" value="Button" onclick="Function()"/> <p id="myId"></p> <script> function Function() { var a = "SN ITFunda Service LLP"; var res = a.charAt(0) document.getElementById("myId").innerHTML = res; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output