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

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -