运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript String</h1> <h2>Bracket Notation</h2> <p>The bracked notation [] returns an indexed character from a string.</p> <p id="demo"></p> <script> let text = "W3schools"; let character = text[0]; document.getElementById("demo").innerHTML = character; </script> </body> </html>