JQuery -Klick -Funktion
$( "#target" ).click(function() {
alert( "Handler for .click() called." );
});
Confused Cobra
$( "#target" ).click(function() {
alert( "Handler for .click() called." );
});
$(document).on("click", ".onClass", function () {
//your code
var element = $(this); // to get clicked element
});
$( "#other" ).click(function() {
$( "#target" ).click();
});
$('#selector').on('click',function(){
//Your code here
});
var myEl = document.getElementById('myelement');
myEl.addEventListener('click', function() {
alert('Hello world');
}, false);
myEl.addEventListener('click', function() {
alert('Hello world again!!!');
}, false);
1
2
3
$( "#dataTable tbody" ).on( "click", "tr", function() {
console.log( $( this ).text() );
});