how to get href value of anchor tag in jquery in list

Solutions on MaxInterview for how to get href value of anchor tag in jquery in list by the best coders in the world

showing results for - "how to get href value of anchor tag in jquery in list"
Stefano
14 Apr 2017
1<div class="getval">
2   		<a href="https://wlearnsmart.com/">W learn Smart</a>
3   </div>    
4
5<script type="text/javascript">
6
7$(document).ready(function() {
8
9  $('.getval a').click(function() {
10    event.preventDefault();
11    var get = $(this).attr('href');
12    alert(get);
13    console.log(get);    
14  });  
15
16});
Pedro
13 May 2020
1<ul class="sub_menu">
2    <li><a href="caps">Caps</a></li>
3    <li><a href="jeans">Jeans</a></li>
4    <li><a href="shorts">Shorts</a></li>
5    <li><a href="foootwear">Footwear</a></li>
6</ul>
7
8
9$('ul.sub_menu li a').click(function() {
10    event.preventDefault();
11    var txt = $(this).attr('href');
12    alert(txt);    
13});
queries leading to this page
jquery return the href valuehow to get href of a tag in jqueryjquery get anchor tag href valuehow to get href in jqueryselecting href elements in jquery jquery href valuehow to get href in jquery best wayhow to select a href in jqueryfind anchor tag with href jqueryhow to get href value of anchor tag in jquery using list tag idget href attr in jqueryhow to get href value in jquery using idget a href link text using jqueryget value of a href jqueryget href in jqueryjuqery get hrefget href from a using jqueryhow to get href value jquerywith div get anchor tag based on href jqueryhow to read href from anchor tag using jqueryget anchor href value jquerypquery get href attributefind a href jqueryhref value get form tag via javascriptget anchor tag value from url jqueryjquery get a tag where href isget href jqueryget anchor url jqueryget href attribute in jqueryget href value from in li a jqueryjquery find value of hrefget href of link jqueryget the href value using jqueryget anchor from url jqueryget href value by jwqueryjquery get element href valuejquery a href valueget a tag href jquerythis href jquerryget href of selected anchor jqueryget the href within the div jqueryhref jquery valuejquerry href to elementget href value jqueryjquery get href value of anchorjquery get anchor value from urlselector a href jqueryjquery change button hrefget href from anchor tag jqueryfind href attribute in html tag using jquerytget href attribute id value jqueryjquery get href attribute under diva href attribute jquerysetting href value in jqueryjquery find href with valuehref value in attr in jqueryget the value of href jqueryrun the href of the element with jqueryassign href value using jqueryget href of anchor tag in jquerya href get value jquery 5chow to get a href value in jqueryhow to find a href jqueryjquery grab href valuehow to get a href in jqueryselect element with href attribute jqueryget href of element jqueryhow i can get anchor tag value in jqueryget anchor by href jquerychange href value jqueryget href value of anchor tag in jqueryget href value jquery to stringget anchor tag value jqueryhow to change href value in jqueryget attribute of anchor tag in jqueryhow to get value of link on a href tag using jqueryjquery a a href valueget href from a jqueryjquery get href attribute valuehow to get a href attrribute jqueryhow to get attr href jqueryhow to change anchor tag href value in jqueryget href a to jqueryget a href value jqueryhow to set href of anchor tag using jqueryjquery get a tag hrefjquery get href valuehow to set href value of anchor tag in jqueryjquer get href of a taghow to get ul 3eli a tag href in jqueryfind anchor by href jqueryhow to get href value of anchor tag in jquery in listjavascript get anchor hrefjquery get href of elementsert value in href tag in jqueryjquery find method in href valuejquery get tag hrefhow to target href in jqueryget href attribute in jquery without parametershow to set link inside anchor tag in jqueryhow to get anchor tag href value using jqueryhow to change href value with jqueryhow to get anchor tag value in jqueryjquery find href value a href value jqueryhow to find href value in jqueryjquery get a href valuehow to get anchor tag hrefvalue in jqueryhow to get href value in jqueryjquery get anchor href valuevalue in html taghow to get value of href in jqueryget anchor tag href value jqueryhow to get anchor tag value from url in jqueryanchor tag href in jqueryget the href value in jqueryhow to get element by href in jqueryfind a with href jqueryget url anchor value jqueryjquery st href of anchorget the href value jquryhjquery get hreffind anchor tag based on href jqueryjquery anchor has hrefjquery get link href attribute and use it for entrie divjquery get href attribute from list itemshow to get href value of anchor tag in jquery from another pageget a href attribute jqueryset a href value jqueryhow to get href value from each a tag in jqueryjquery get anchor tag containing hrefjqury set hrefget link href jquerytake href value jqueryget href a jqueryget href tag jqueryfind href value in jqueryhow to get the anchor tag value in jqueryjquery 23element hrefjquery change href valueget href of a jqueryget source in anchor tag href value jqueryget value of href attribute jqueryjquery get href attributeget href attribute jqueryget href anchor javascriptget anchor attribute in jquerychange href of anchor tag jqueryjquery get element on hrefjquery get hrefselecting href jqueryjquery anchorhow to get this href value in jqueryjquery href 23 valuefind next href and add class jqueryjquery href text valuehref value in jqueryget href attribute value jqueryjquery get href textjquery this href valuehow to get the value of anchor tag in jqueryhow to get href value from a tag in jqueryhow to set anchor tag href value using jqueryget a href attr with jqueryjquery get anchor from urlhow to get a tag href value in jqueryjquery get href of a tagget href of the element using jqueryjquery get href of anchorhow to get anchor tag href value in jqueryjquery refer to href attribute clickjquery get the value of hrefa href get href value jqueyget href id jqueryget href attribute of a element jqueryfind url with anchor tag usingjqueryget href link jqueryhow to get href value of anchor tag in jqueryhow to get anchor tag value in javascriptcheck href value jqueryget href from a tag jqueryjquery get href value of linkhow to get link of an anchore tag using jqueryget value from href jqueryjquery get element hyperlink hrefjquery get the href valueselect anchor element by href attribute jqueryjquery get anchor tag matching hrefget href using jqueryhow to find a selector by href attribute value in jqueryget href of a tag jqueryhow to get value of anchor tag in jquerychange a href value jqueryhow to get href value of anchor tag in jquery in list