Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Text | Q1122 [ previous next ]

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>

©2018 Martin Webb