JS căn bản] -id374 - 1
RUN
<html> <body> <input type="button" id="show-btn" value="Click me" /> <script language="javascript"> // Lấy đối tượng var button = document.getElementById("show-btn"); // Thêm sự kiện cho đối tượng button.onclick = function() { alert("Bạn vừa click vào button"); }; </script> </body> </html>
PHÓNG TO