Question: I have the value `0x4D79205465737420537472696E67` in a varchar(max) column in SQL Server. I want to convert it into binary value `0x4D79205465737420537472696E67` and retrieve the first 3 bits of the 0th Byte.

Any help would be appreciated, thanks.

Answer: 
if you handle the click event, you will get the element in this variable. you can store it in a local or even a global variable to keep a reference to it. something like this:

outside of the event handler, maybe on load of the page:

```
var lastClickedElement;

```

and then inside your click event handler:

```
function() {
    lastClickedElement = this;
}

```

and then you have always a reference to the last clicked element.
Simply hold the element that has been clicked and store it. That would help you retrieve it later without explicitly defining an id attribute. 

HTML :

```
<a href="#a">Bar</a>
<a href="#b">Foo</a>

```

javaScript :

```
var clickedNode = [];
var counter = 0;

$("a").click(function(){
    clickedNode[counter] = $(this);
    alert(clickedNode[counter].text());
     counter++;
});

$("#lastValueButton").click(function(){
    alert(clickedNode[counter-1].text());
});

```

[**Demo**](http://jsfiddle.net/codeSpy/5JWMk/)