JQuery Click Funkcja
$( "#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();
});
$("#button").click(function () {
//result show on console.
console.log("Button Was Click");
//console.log(this);
});
$(document).on("click","#test-element",function() {});
<script>
$(document).ready(function(){
$("#btn-txt").click(function(){
var ptext = $("#my-para").text();
alert(ptext);
});
});
</script>
<button type="button" id="btn-txt">Get Text Content</button>
<p id="my-para">This is a paragraph to Show jQuery text method.</p>