+ 1

How to Get value of attributes using other attribute same tag (SOLVED)

<li><a tabindex="-1" data-value="RL" selected="selected">Rated Lead <li><a tabindex="-1" data-value="MJL">My Job Lead I want to fetch data-value where selected = selected https://code.sololearn.com/W0JLCAt0XuE4/?ref=app

8th Apr 2021, 1:53 PM
Dhaval Makwana
Dhaval Makwana - avatar
3 Answers
+ 2
Isn't that working for you? When I click a select menu item for "Related Lead", the alert says "RL". RL corresponds with data-value="RL". That's what you're describing so did you fix your problem after posting this question? This line looks good too: alert (jQuery('.clickdp li a[selected="selected"]').data("value"));
9th Apr 2021, 12:02 PM
Josh Greig
Josh Greig - avatar
+ 1
glad you solved it
9th Apr 2021, 3:46 PM
Josh Greig
Josh Greig - avatar
0
Josh Greig Yes, I have solved yesterday..
9th Apr 2021, 3:45 PM
Dhaval Makwana
Dhaval Makwana - avatar