运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,深色/浅色
转到空间
<!DOCTYPE html> <html> <body> <h1>JavaScript String Methods</h1> <h2>The strike() Method</h2> <p id="demo1"></p> <p>The strike() method is deprecated in JavaScript.</p> <p>Use the del tag instead:</p> <p id="demo2"></p> <script> let text = "Hello World!"; let result = text.strike(); document.getElementById("demo1").innerHTML = result; text = "<del>Hello World!</del>" document.getElementById("demo2").innerHTML = text; </script> </body> </html>