So I have
<span onclick="show(this)">foobar</span>
function show(theSpan) {
....... //select the span here
}
How could I use Jquery selector to select the span? I tried $(theSpan) but it doesn’t work. I want to select it as a Jquery object so that I can apply attr() to it.
Thanks!
$(theSpan).attr('test, '123');works fine.Your problem lies somewhere else.