Home / JS / addEventListener basic

addEventListener basic

<span id="elem">Hello!</span>
<script> elem.addEventListener('click',function(){
alert('hello');
}); </script>

Hits: 65

%d bloggers like this: