<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <a href="#" title="我是默认HTML的属性" id="app">周,漏气没</a> </body> <!--js设置其他属性值--> <script type="text/javascript"> var oApp = document.getElementById("app") oApp.href = "http://www.baidu.com" oApp.title = "我是js生成的属性,酷吗?" </script> </html>