源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>编程字典</title> </head> <body> <p>code不保留空白和换行.</p> <p>如果要保留可以使用pre 元素:</p> <pre> <code> var x = 5; var y = 6; document.getElementById("demo").innerHTML = x + y; </code> </pre> </body> </html>
运行结果