I have been googling, a lot, and found quiet many similar issues around the www but not anything that nails my issue to the ground.

I have a jquery function that get the href attribute from an anchor tag, which is supposed to return this value - #SomeIDHere

On my development environment it works perfectly, but on production it returns the current URI + the #ID. I only need the #ID part to make the rest of the script work as intended.

This is how I get the href, now I only need to split the href value and get the #ID part.

```
function myFunction(sender) {
    var id = sender.getAttribute('href');
    alert(id);
    // functionallity here...
}

```

I have tried this [solution](https://stackoverflow.com/questions/4059193/jquery-href-anchor-value) which was a brilliant start but when I tried implementing it I only got undefined values or javascript errors.

Some of the things I tried:

```
function myFunction(sender) {
var id = sender.getAttribute('href');
var newID = $(id).search.split('#')[1]; // got an error
alert(id);
// functionallity here...
}

function myFunction(sender) {
var id = sender.getAttribute('href');
var newId = $(id).split('#')[1]; // got an error
// functionallity here...
}

function myFunction(sender) {
var id = sender.getAttribute('href');
var newId = $(sender)[0].search.split('#')[1]; // returned undefined
// functionallity here...
}

```

Any thought or ideas of how to do this? I'm kind of lost at the moment.