I am trying to set the z-Index through Jquery, but I need every DIV except for one called importantdiv to be from 0-100. The only problem is that importantdiv gets a z-index of 40 instead of 510? what Did I do wrong in my jquery code?
<script src="scripts/jquery-1.5.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
var zIndexNumber = 100;
$('div').each(function() {
$(this).css('zIndex', zIndexNumber);
zIndexNumber -= 10;
});
$('#importantdiv').css('zIndex', 510);
});
</script>
try this: