Answers for "add element listener javascript"

47

js add click listener

document.getElementById("myBtn").addEventListener("click", function() {
  alert("Hello World!");
});
Posted by: Guest on July-10-2020
1

addEventListener

<body style="height: 5000px">
 <style>
    body, /* blink currently has bug that requires declaration on `body` */
    html {
      scroll-snap-type: y proximity;
    }
    .snaptarget {
      scroll-snap-align: start;
      position: relative;
      top: 200px;
      height: 200px;
      background-color: green;
    }
 </style>
 <div class="snaptarget"></div>
</body>
Posted by: Guest on May-19-2020

Code answers related to "add element listener javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language