how to remove # from href value in jquery

Actually I need to remove '#' from href value, I had used replace method but its not working. Suppose I get value in targetId=#general1,from that I need to remove # and i need to append it to another class.

$(document).ready(function() {    
    $('.dropdown-menu li a').click(function() {    
        var targetId = $(this).attr('href');    

Answers 1



    This will work fine though it will replace all #

Related Articles