JSFiddle - React, Tailwind, and code Playground

by Dineshkani

HTML

<div id="firstdiv" class="sample">
    <div name="jQuery"> Hello Jquery </div>
</div>
<input type="button" value="eq" />
<input type="button" value="get" />

CSS

.sample{
    width: 250px;
    color: blue;
    text-align: center;
}

JavaScript

$("input[value='eq']").click(function(){
    alert($("div").eq(0));
});
$("input[value='get']").click(function(){
    alert($("div").get(0));
});

//Note: eq returns the jquery Object containg the DOM but get return the DOM element directly.