I have a value passed via a # in the url this is the class name of a checkbox what i am trying to do is get the value of that checkbox ID using jQuery
// get hashtag value
if(self.document.location.hash){
var urlhash = self.document.location.hash;
var hashtagval = self.document.location.hash.replace("#","");
// get id of element from hashtagval (class name)
var counter = $('.'+hashtagval).attr('id');
}
OK, I tested it and it works fine with adding #a and #b to the hash.
Beside you are abusing the hash attribute. The hash attribute is used to define a viewstate of the page (e.g. the screen should move to this paragraph) not to store some local varibles, which are then used for application logic!