Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

document on click jquery

$(document).on("click", ".onClass", function () {
    //your code
    var element = $(this); // to get clicked element
});
Comment

jquery on click

$( "p" ).on( "click", function() {
  alert( $( this ).text() );
});
Comment

on click jquery

$( "#target" ).click(function() {
  alert( "Handler for .click() called." );
});
Comment

jquery on click function

//1st way
$(".searchCategory").click(function () {
  //your code here
});

//2nd way
$(".searchCategory").on( "click",getCategory);	// getCategory is a function but don't need the pharenthesis
//if you write getCategory() instead of getCategory when getCategory is a function with no pharamenters it might not work
Comment

jquery $(document.on click

$(document).on("click","#test-element",function() {});
Comment

jquery on click

$(document).on('click' , '.class' , function(){
	//event
})
Comment

jquery click

<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>
Comment

jquery on click

$(document).on('click touch', '.your-element', function () { ... });
Comment

.on click jquery

1
2
3
$( "#dataTable tbody" ).on( "click", "tr", function() {
  console.log( $( this ).text() );
});
Comment

.on click jquery



var myEl = document.getElementById('myelement');

myEl.addEventListener('click', function() {
    alert('Hello world');
}, false);

myEl.addEventListener('click', function() {
    alert('Hello world again!!!');
}, false);


Comment

PREVIOUS NEXT
Code Example
Javascript :: random id js 
Javascript :: regex yyyy-mm-dd 
Javascript :: document ready function 
Javascript :: javascript roman to integer 
Javascript :: javascript leave page warning 
Javascript :: react start new app 
Javascript :: parse document.cookie 
Javascript :: drupal 8 link render array 
Javascript :: js remove undefined from array 
Javascript :: running shell commands javascript 
Javascript :: how to run a vue js hello world app in vue version 3 
Javascript :: uuid react 
Javascript :: go to page jquery 
Javascript :: javascript even mouseout 
Javascript :: how to reload the same page using javascript 
Javascript :: set select option as selected jquery 
Javascript :: vuejs v-for reverse 
Javascript :: javascript get current time 
Javascript :: fibonacci sequence in javascript using for loop 
Javascript :: wait for element javascript 
Javascript :: synchronous ajax 
Javascript :: eslint change max line length 
Javascript :: run react native app in production mode 
Javascript :: clone object in js 
Javascript :: js math round up 
Javascript :: js update query string 
Javascript :: how to root with any number in js 
Javascript :: javascript reduce function to get sum of object value 
Javascript :: javascript go back to last page 
Javascript :: how to drawImage on center of canvas 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =