JQuery Haga clic en la función
$( "#target" ).click(function() {
alert( "Handler for .click() called." );
});
Confused Cobra
$( "#target" ).click(function() {
alert( "Handler for .click() called." );
});
$( "#other" ).click(function() {
$( "#target" ).click();
});
$('#selector').on('click',function(){
//Your code here
});
$( "p" ).on( "click", function() {
alert( $( this ).text() );
});
$( "#dataTable tbody tr" ).on( "click", function() {
console.log( $( this ).text() );
});
<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>