get a value from a clicked href, I need to get 'espresso' when I click the 1st link etc |
get a value from a clicked href, I need to get 'espresso' when I click the 1st link etc |
Londy |
Dec 19 2023, 05:34 AM
Post
#1
|
Group: Members Posts: 6 Joined: 19-December 23 Member No.: 29,102 |
CODE <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> </head> <body> <ul id ='coffeeList'> <li value='espresso'><a href="#">espresso</a></li> <li value='caramel fudge latte'><a href="#">caramel fudge latte</a></li> <li value='hot chocolate'><a href="#">hot chocolate</a></li> </ul> <script> $('li a').click(function(e){ e.preventDefault(); var href = $(this).attr('href'); console.log(href) }); </script> </body> </html> |
Darin McGrew |
Jan 17 2024, 10:06 AM
Post
#2
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
QUOTE Though "nose breathing" really replaced "mouth breathing" in my lexicon during COVID... when we had the people who would begrudgingly wear the mask, but keep it pulled down past their nose completely defeating the point of it. I hadn't heard that one before. Thanks for the laugh. Don't get me wrong. I've seen the described behavior among people who wore obligatory masks. But I had never heard that used to suggest that "nose breather" had replaced "mouth breather" as a derogatory term. |
Lo-Fi Version | Time is now: 10th June 2024 - 06:18 AM |