TAG
CSS
JavaScript
Result
Run
License
<form name="myform" action="/process.php" method="post" enctype="application/x-www-form-urlencoded" target="_blank"> <input type="text" /> <button type="button" id="btn" name="btn">OK</button> </form>
label { border: 1px solid #ccc; padding-inline: 20px; border-radius: 3px; background: #eaeaea; }
window.addEventListener("load", () => { const $elBtn = document.getElementById("btn"); $elBtn.addEventListener("click", e => { console.log(e.currentTarget.name); }); });
Console
expand_less
License
License
by DevDic
Close