views:

67

answers:

3

cauz i have to use a normal dom-element ,

the dom-element is like this : document.getElementById('a') or document.createElement('div')

so my mean is change $('#a') to document.getElementById('a')

can jquery do this ??

thanks

+4  A: 

You can reference the DOM element with .get(0) or [0], eg $('#foo')[0] assuming there is just one.

meder
+2  A: 
$('#a')[0]

// oops my answer is too short

Anantha Kumaran
A: 

That is what get() method was made for by JQuery team, consider:

var elem = $('#a')[0];

Or

var elem = $('#a').get(0);

document.getElementById(elem)..........
Sarfraz