html - jquery image click event for specific images -


i have images dynamically added page, , on page have jquery function shows when image clicked. works fine, have static images on page don't want clickable function.

this jquery runs whenever image selected. can't use theid element of images because different time.

$().ready(function () {     $('img').click(function () {         //do     } } 

how can make images want run function when clicked?

try this:

add class images want clickable. example:

<img class="clickableimage">  $(document).ready(function () {     $('.clickableimage').click(function () {         //this  work images having class ="clickableimage"         //do     } } 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -