jquery – how can I select element after ‘.first()’ using?

How can I select html tag after using jquery function called .first() ?

HTML

<html>
  <head> </head>
  <body> 

       <div>
           <a>
              <img id="#hello">
           </a>
       </div>

       <div></div>
  </body>
 </html>

JS (JQuery)

var elemFirst = $(div).first();
var selectImg = elemFirst.$('img#hello');

// var selectImg = elemFirst.find('img'); <- It working but I want to select manual 

selectImg.addClass('some-css');

With Respect


Source: jquery

Leave a Reply