outerHTML获取本标签全部内容
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>index</title> <style> *{ font-family: 微软雅黑; } </style> </head> <body> <h1 info='php is very much!' id='hid' class='hcls'>linux is very much!</h1> </body> <script> hidobj=document.getElementById('hid'); alert(hidobj.outerHTML); </script> </html>
世界上最美的风景,是自己努力的模样