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$('a').attr('href'); // gets the actual value
2$('a').prop('href'); // gets the full URL always
3