I have a function that prepends a li tag to a parent div just fine...however, after the prepend, i want to act upon this prepended list item by changing css properties when hovered on but the jQuery selector can't find it (seemingly because the .hover function is searching for list items available to act upon when the page loads..and the prepended items are nonexistent when the page loads).
My prepend code looks like this:
$("div#content-text div#sub-text").prepend(
"<li id='item1' class='contents-rec'><div class='text'></div></li>");
while my hover code (not working) looks like this:
$("div#content-text div#sub-text li.contents-rec").hover(function(){
$(this).css({border:'1px solid #fff'});
}, function(){
$(this).css({border:''});
},0);
any help would be greatly appreciated!! thanks in advance