ID's can't start with numbers. Adding onclick to your markup is moving backwards with jQuery.
Currently your hide function is not available in the DOM for onclick's as it is closed within jQuery and therefore is not a global function.
You seem stuck on needing to use ID's when it's not necessary. Had you changed to class="someDivClass" instead of ID="hide" could easily do :
$("div.someDivClass a").live('click',function() { // use live() due to elements won't be in DOM when page loads
$(this).parent("div.hide").hide();
});
This will cover all of the divs that get created and you want to be able to hide. If you want to delete them, use remove() instead of hide().
You also have a function die() that is undefined and throwing an error
Jerry Johnson wrote:
bump
No comments:
Post a Comment