how to get attribute from any selected object in jquery
for example
<a href="http://stackoverflow.com" class="selected">stackoverflow</a>
my jquery is h开发者_Go百科ere
alert($('.selected').attr('href'));
but this don't work
How to get attribute from selected object?
The anchor tag should have an href attribute, not src.
You say scr in the anchor tag and src in the jquery expression. Also anchors have href not src attributes.
精彩评论