hi,

I'm working on a cms and have hit a brick wall with something. I have
the following html

ul
- li
- - input.is-hero
- - input.weight
- ul
- - li
- - - img.thickbox (preview)
- - - img.is-hero

I'm listening to the click event of is-hero, but can't seem to get
from that back up the tree to the input to set it's value. This is
what I have (that's broken):

$(".admin-add-edit-media-make-hero").click(function()
{
        console.log('hello i have been clicked, click click click');
        
        // parent li
        var ul = $(this).parent();
        var li = $(this).parent().parent();
        var input = $(li).find('input');
        
        console.log('ul: '+ul); // ul: [object Object]
        console.log('li: '+li); // li: [object Object]
        console.log('input: '+input); // input: [object Object]
        
});
        
No matter what I try though comes up as undefined after this, eg:

input.attr('id'); // undefined
input.val(); // undefined

also tried $(li).find('input.is-hero) but that got me nowhere.

grateful for any tips.

Cheers,

Jon

-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

Reply via email to