Mar
08
Get JavaScript Object From jQuery
Today I searched Get JavaScript Object From jQuery trying to fix old code. I wanted to fix it by using some jQuery selectors but I still wanted to use most of the old JavaScript code. I initial passes up the jQuery page on the .get() method but then came back to it and was exactly what I needed.
Retrieve the DOM elements matched by the jQuery object.
So it was simple to get the first element of the selector with the get object.
var javascriptVar = $("#jQuerySelector").get(0);
This worked perfectly and allowed all of the old javascirpt to function with the more advanced selector than the good old document.getElementById()

