You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Adding a click event listener to the button
document.getElementById("myButton").addEventListener("click", function() {
alert("Button clicked!");
});
Activity
AadiSharma49 commentedon Sep 25, 2024
I just create an example using HTML,CSS,JS to not use iframe
<title>Button without iframe</title>Click Me
<script src="script.js"></script>AadiSharma49 commentedon Sep 25, 2024
#myButton {
background-color: #4CAF50;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 8px;
}
#myButton:hover {
background-color: #45a049;
}
AadiSharma49 commentedon Sep 25, 2024
// Adding a click event listener to the button
document.getElementById("myButton").addEventListener("click", function() {
alert("Button clicked!");
});