creating a DOM element

creating a DOM element

Hey,

I'm not quite sure if it's a bug. Anyways I'm experiencing the following behavior:

  1. var _new_li     = $('<li/>', {
  2.     'id': 'p',
  3.     click: function(){
  4.         alert('fired');
  5.     },
  6.     data: {
  7.         'somedata': 'somedata',
  8.     }
  9. }),
If I use that order, event (click) before data, I receive an exception on click.
" e is undefined" or " events is undefined".
If I switch the order, data before click, works just fine.



Kind Regards
--Andy