Jquery (nearby selector?)
I'll explain with an example.
Our html is this:
<span>ok
<span>1</span>
<a href=''></a>
</span>
and my jquery code is this:
$("a").live('click', function(){
var a = $(this).closest("span");
alert(a);
});
but it gives me "ok 1 " as a result. i just want to have "1" only.
how can I choose "nearby tag"?
No comments:
Post a Comment