JavaScript charAt():-genius of student


  • The charAt() method returns the character at the specified index in a string.
  • The index of the first character is 0, the second character is 1, and so on


  • Code:- 
  • <!DOCTYPE html> 
  • <html> 
  •  
  • <head> 
  •  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  • </head> 
  •  
  • <body> 
  •  
  •  <h1>charAt()</h1> 
  •  
  •  <input type="button" onclick="strfun();" value="Get Answer"> 
  •  
  •  <script> 
  •   function strfun() 
  •   { 
  •  
  •    var str = "Testing"; 
  •    alert(str.charAt(1)); 
  •   } 
  •  </script> 
  •  
  • </body> 
  •  
  • </html>



  • JavaScript charAt():-genius of student JavaScript  charAt():-genius  of student Reviewed by Network security on June 23, 2019 Rating: 5

    No comments:

    Useful Information

    Powered by Blogger.