omrehman omrehman - 9 months ago 44
jQuery Question

Jquery : how to get name of next element

I had written a jquery code

var next_element =$(this).next();

In a jquery event. But I got Ouput as
. why did it happens? if this is incorrect, how did i get the name of element next to the event happening ??

Answer Source

$('#qew').click(function() {

<script src=""></script>
<button id="qew">this</button>
<button name="that">that</button>