Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1122 Is there any way to find the ASCII value of a character?

irt.org | Knowledge Base | JavaScript | Text | Q1122 [ previous next ]

Q1122 Is there any way to find the ASCII value of a character?

You need charCodeAt():

<script language="JavaScript"><!--
Test = 'Hello World';
Values = '';

for (i=0,n=Test.length;i<n;i++)
    Values += Test.charAt(i) + ' = ' + Test.charCodeAt(i) + '\n';

alert(Values);
//--></script>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.