執行 ❯
建立您
自己的
網站
×
更改方向
儲存程式碼
更改主題,深色/淺色
前往Spaces
<!DOCTYPE html> <html> <body> <h1>The DOMTokenList Object</h1> <h2>The item() Method</h2> <p>The first item in the list is:</p> <p id="demo" class="c1 c2 c3"></p> <script> let list = document.getElementById("demo").classList; let item = list[0]; document.getElementById("demo").innerHTML = item; </script> </body> </html>