tags:

views:

30

answers:

3
var current = $(this).attr('href');
alert(current);

shows the value with '#' eg '#target' instead of just 'target', what do I modify in the code?

Thanks

+1  A: 
var current = $(this).attr('href').slice(1);
alert(current);
jAndy
+1  A: 

As easy as this, just use replace:

var current = $(this).attr('href').replace('#','');
jigfox
+2  A: 

I assume you're dealing with a <a> element?

this.hash.substring(1); // yes, it's that simple...
J-P