JSFiddle - React, Tailwind, and code Playground
by Dineshkani
HTML
<div id="firstdiv" class="sample">
<div>Hello Jquery</div>
<div>Welcome to Tutorial</div>
<div>Hello World</div>
<div>Ends</div>
</div>
<input type="button" value="get first child" />
CSS
.sample{
background-color: white;
height: 140px;
}
JavaScript
$("input").click(function(){
alert($("#firstdiv > div").first().html());
});
//It gets the first element from th collections of object