Hi all,
I am doing some self-learning about JQuery and stuck over a question:
I am trying to use the JQuery next() API to grab the data from the Text Box field of Hidden type, but I failed to do so.
Here is my code:
$(document).ready(function(){
$(".Testing").click(function(){
var what = $(this).next().val();
alert(what);
});
});
<span class="Testing">Hello</span><br/>
<input type="hidden" value="World">
<span class="Testing">Hi</span><br/>
<input type="hidden" value="There">
Could you help me solve the question please?
Reference link: http://stackoverflow.com/questions/3223446/grab-the-id-of-a-span-tag-and-add-some-value-to-a-text-box-field-according-to-whi