运行 ❯
获取您
的
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Strings</h1> <h2>The charCodeAt() Method</h2> <p>charCodeAt() returns the Unicode of the character at a specified position in a string.</p> <p>The 15th character in "HELLO WORLD" returns NaN (Not a Number):</p> <p id="demo"></p> <script> let text = "HELLO WORLD"; let code = text.charCodeAt(15); document.getElementById("demo").innerHTML = code; </script> </body> </html>