I need to get neighborhood element value.
HTML is
<div>
<input type='hidden' value='12345'>
<div id='click-this'>Click me</div>
</div>
How can i get “12345” by clicking “click-this” div ?
$('#click-this').click(function() {
/*
* Get siblings element's:
* at this context, input tag element with value 12345
*
*/
})
You could do this in multiple ways, but the word neighborhood suggests you could use siblings: