jquery - Cannot find the next div attribute id -



jquery - Cannot find the next div attribute id -

i trying find next element of id,can please suggest find next element of id.

i having html code:

<div class="togg_child" style="font-size: 17px; margin: 5px;"> <a id="cats_1" class="test" href="javascript:">diamond</a> <div id="subctg_1" class="test1"></div> </div>

i using jquery function:

$(document).ready(function () { $('.test').click( function(){ var tid = $(this).attr('id'); alert(tid); $("#"+tid).parent().next('div').attr('id'); alert(id1);die; }); });

just remove parent():

$("#"+tid).next('div').attr('id');

or this:

$(this).next('div').attr('id');

this subctg_1 id.

and don't utilize die available in php not in js.

jquery html css

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -