jcadima
1/5/2017 - 5:12 PM

Get href value for clicked element

Get href value for clicked element

http://jsfiddle.net/NmzRV/

here we are using anchors #, we can change to query string ? if needed
<a href="#3455" class="change_status">Aminul</a><br/>
<a href="#988495" class="change_status">Arif</a><br/>
<a href="#94858915" class="change_status">Sharif</a><br/>


<script>
$(document).ready(function() {
         $("a.change_status").click(function(){
           // change to ? if we are using a query string
           var status_id = $(this).attr('href').split('#');
           alert(status_id[1]); 
           return false;
        });
});

</script>