<html> <body> <button onclick="var myS = new String('Sample String'); alert(myS.charAt(3));">String: CHARAT</button> </body> </html>