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});
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});