javascript - how to get id of next div using previous id using jquery -
i want id of next element using jquery
. html code is follow.
<div id="sms_message-0"><div id="nl-form-0" class="nl-form"></div>
i have tried this,
y= $('#sms_message-0').next().find('div').attr("id"); console.log(y);
here nl-form-0
dynamic . want it's id using static id sms_message-0
.
that's not next element, it's first child
var y = $('#sms_message-0').children().first().attr('id');
Comments
Post a Comment