Add click event on div tag using javascript

The Solution to Add click event on div tag using javascript is


Pure Javascript

document.getElementsByClassName('drill_cursor')[0]
        .addEventListener('click', function (event) {
            // do something
        });

jQuery

$(".drill_cursor").click(function(){
//do something
});

~ Answered on 2013-12-25 12:56:15


Most Viewed Questions: