Character to ascii code: use charCodeAt();ascii code to character: use fromCharCode(); Look at a small example Copy the code The code is as follows: <br>str="A";<br>code = str.charCodeAt(); <br>str2 = String.fromCharCode(code);<br>str3 = String. fromCharCode(0x60 26); <p>document.write(code '<br />');<br>document.write(str2 '<br />');<br>document.write(str3);<br>< ;/script><br></p> </div> <br>Output: <p>65<br>A<br>z</p>