Jquery href anchor value

后端 未结 4 609
小蘑菇
小蘑菇 2020-12-21 18:38

I am having an anchor link in aspx page like:

Go
<
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-21 18:49

    To get the href of the link:

    var href = $('#Anchor').attr('href');
    

    To get the HTML inside:

    var html = $('#Anchor').html();
    

    #Anchor is the CSS-format selector that means, "Select the element with the ID 'Anchor'."

提交回复
热议问题