<script type="text/javascript"> $(document).ready(function() { $(".component ol li").hover(function() { $(this).css('list-style-type', 'disc'); } ); }); </script>
If you don't have document.ready, it will be executed before your list items are added to the DOM, so it does practically nothing. Or move the entire section after the list items.
EDIT: for further discussion: it's best not to use document.ready , as it should wait until everything on the page finishes loading. With this in mind, you can always put these initialization blocks at the end of html to make sure that all DOM objects are created when this is done.
Or the second object should use .live() . This function attaches the event to the result of the selector whenever an element is created that is suitable for the selector. Now you can save this block at the top and use:
<script type="text/javascript"> $(".component ol li").live('hover', function() { $(this).css('list-style-type', 'disc'); }); </script>
Now, when something that matches $(".component ol li") added to the DOM, your hover function will be bound.
source share