1. 你可以不用创建html文件,在浏览器中快速运行hmtl
在浏览器的地址栏中输入:
data:text/html,<h1>Hello, world!</h1>
注意:在IE中不行 -_-! (本人在chrome 和firefox中测试均可)
2. 你可以在浏览器中不通过JS也能使页面里的CSS可编辑,
<!DOCTYPE html>
<html>
<body>
<style style="display:block" contentEditable>
body { color: blue }
</style>
</body>
</html>
(这个在IE中也不行!)
3. 你可以在一个if 后面不用花括号也能执行多条语句
if (confirm("Do you wish to see two alerts?"))
alert(1), alert(2);
这个在ie chrome firefox等主流浏览器中都可以
很简单的翻译,继续加油!!!