Problem with Next Selector
I need to do a pretty simple and strait forward next select, but i am stuck.
I would like to click on an image, then get the next radio box and check it.
at the moment, i am just trying to get the correct element, after that, i should be able to check it ok.
Im using .net, and it puts radio boxes in to spans. so here is the HTML
<img class="test" />
<span class="test">
<input type="radio" id="test" />
</span>
and here is what i tried.
$(document).ready(function () {
$("img.test").click(function() {
alert($(this).next().children('input:radio').attr("id")); // works, but on my actual page i have about 10 other elements between the image and the radio box, so dont want to have to do next next next....
alert($(this).next("span input:radio").attr("id")); // this is what i initially thought should work, but it doesnt.
});});
if i remove from the span, and just do next input that works, and if i traverse to it, node by node it works.
I jut cant go, next span input.
Any Help?