[jQuery] click Event Problem with appended html element

2009-11-07 Thread ndes
Hi! I was wondering if i made something wrong or this dont works in
general. I have a drop down list that onChange loads some data an
pops a list of img+text

$('#selectDisplay').change(function(){
.
//LOOP
$(#btnDisplay).append('img class=btnDisp
value='+respObj.jsonarray[i]['id']+' style=vertical-align: bottom;
padding: 0 6px; src=img/fam/add.png /'+respObj.jsonarray[i]['name']
+'br /');
.
});


I also have a general even on $(document).ready(function() {

$('.btnDisp').click(function(){
//DO SOMETHING ex.
alert(working);
});

The problem is that on dynamic generated img's (custom btns) the
onClick Alert doesnt work. But it works on static .btnDisp imgs that
loads with the html...

So what can I do for something like this?
Thanks in advance!


[jQuery] Multi Combined Selectors

2009-09-18 Thread ndes

hi all. i'm new here and i hope posting in right place. I'd like to
ask if and how I can add multicombined selectors like:
$(this).parent().parent().$(input:checkbox[class='list']).attr
('checked')

I know that the $(input:checkbox[ppb='list']) isn't right but i just
want to show you what i want to do.

I'm already inside a selector:
$(input:button[name='delete']).click(function() {
 if ($(this).parent().parent().$(input:checkbox[class='list']).attr
('checked')) {
 //dosomething
}
});

is this posible?
thanks in advance
N.