Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ascii code

Status
Not open for further replies.

oil

MIS
Joined
Mar 3, 2005
Messages
2
Location
GB
Hi,
Any body know how to convert character to ascii code with JavaScript. So please tell me

Oil

 
The simple way is to use charCodeAt. However this is only compatible with newer browsers (>=version 4):

var c='a';
var a=c.charCodeAt(0); // ascii value of c

Here's an article on how to do it without charCodeAt:

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top