🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# getAttribute 获取元素属性 ~~~ <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>DOM-obj</title> </head> <body> <a href="http://blogcurder.sinaapp.com" id="aid" title="a标签的title属性值"></a> <script> aNode = document.getElementById('aid'); console.log(aNode.getAttribute('title')); // a标签的title属性值 </script> </body> </html> ~~~