<div id="preen_me" class="twitter_list"></div>
I have a jquery plugin which fills this div with a list of twitter post (ul and li’s).
I want to get the list (it’s content by order). on mouseup(or click) The problem that jquery doesn’t seem to find that list because it is loaded after the page loads(i think)
I tried
$(document).ready(function() {
$("#preen_me").click(function () {
alert($(this).find('ul').attr('class'));
alert($(this).closest('li').attr('class'));
});
});
but I get an undefined value. (they both have classes attributes, in case you are wondering)
Use
find()method forlias well.. Methodclosest()goes up thru the DOM, which is not what you want I guess.DEMO