How to get a DOM Element from a jQuery Selector ?
The Document Object Model (DOM) elements are something like a DIV, HTML, BODY element on the HTML page. A jQuery Selector is used to select one or more HTML elements using jQuery. Mostly we use Selectors for accessing the DOM elements. If they are only one particular unique element in the HTML page we can access it by it’s tag as $(“tag”), but when we have more than one of its kind then we will access them with the ID that when $(“#id”) comes into play.
Below examples illustrates the approach.
Example 1: This example will use the $(“selector”).get(0):
Example 2: This example will illustrate the use of $(“selector”) selector.