Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 0.40 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How can I get elements I add with jQuery to follow the actions I've applied to a class?
  2. $('body').on('click', '.clickable', function() {
  3.     ..
  4. });
  5.        
  6. $(".clickable").live('click',function(){
  7.  
  8. //do something
  9.  
  10. });
  11.        
  12. $(document).ready(function() {
  13.    $('.clickable').live('click',function() {
  14.       //
  15.    });
  16. });
  17.        
  18. $(document).ready(function() {
  19.    $('.clickable').on('click', function() {
  20.    });
  21. });