danielhpavey.uk

A sorta, kinda, web development and design blog...

How do I pull a native DOM element from a jQuery object?

Ruthless plagiarised from the jQuery website

A jQuery object is an array-like wrapper around one or more DOM elements. To get a reference to the actual DOM elements (instead of the jQuery object), you have two options. The first (and fastest) method is to use array notation:

$( "#foo" )[ 0 ]; // Equivalent to document.getElementById( "foo" )

Friday 17 February 2017

Tags: #web development #javascript #jquery