2
Contributors
1
Reply
14
Views
3 Years
Discussion Span
Last Post by eburlea
1

Does it help you?

<div id="parent">
    <div id="id1">1</div>
    <div id="id2">2</div>
    <div id="id3">3</div>
    <div id="id4">4</div>
    <div id="id5">5</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    var divsTotal = $('#parent div').length-1;
    var divId = $('#parent div:nth-child(' + divsTotal + ')').attr('id');
    alert(divId);
});
</script>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.