get the ID of last DIV inside a DIV using jQuery
html, jquery
Solution
You can try this:
jQuery Code
$(document).ready(function(){
$('#container').children().last().attr('id');
});
Problem
I have the below. ``` <div id=container> <div id=box1></div> <div id=box2></div> <div id=box3></div> <div id=box4></div> <div id=box5></div> <div id=box6></div> </div> ``` What is the correct way to get the id of the last div inside container using jQuery?