I have the following HTML:
<label>Lobby Template:</label>
I want to convert it to jquery object and add an attribute id with a value of test:
<label id="test">Lobby Template:</label>
$('label')[0].id="test";
You need to have some sort of hook to identify your element. http://jsfiddle.net/RQ3vH/1/ is a demo.