一、點擊某個事件出現事件的標籤名javascript
<!-- lang: html --> <!DOCTYPE html> <!-- lang: html --> <html> <!-- lang: html --> <head lang="en"> <!-- lang: html --> <meta charset="UTF-8"> <!-- lang: html --> <title></title> <!-- lang: html --> <!-- lang: html --> </head> <!-- lang: html --> <body> <!-- lang: html --> <input type="button" name="hello"> <!-- lang: html --> <div style="height: 200px;width:100px;background-color:#00ee00"></div> <!-- lang: html --> <script type="text/javascript"> <!-- lang: html --> document.onclick = function(e){ <!-- lang: html --> var e = (e||event); <!-- lang: html --> var o = e["target"]||e["srcElement"]; <!-- lang: html --> alert(o.tagName.toLowerCase()); <!-- lang: html --> } <!-- lang: html --> </script> <!-- lang: html --> </body> <!-- lang: html --> </html>