Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


how to get nth jquery element


how to get nth jquery element  using -'jquery'

asked Sep 24, 2015 by sameer rathore
0 votes
6 views



Related Hot Questions



Government Jobs Opening

" rel="nofollow" target="_blank">http://code.jquery.com/jquery-2.1.0.min.js">
  1. First
  2. Second
  3. Third

When it runs, there are two items in the ordered list that show, First, and Third. The second was hidden.

answered Sep 24, 2015 by suyesh.lokhande
0 votes

If you already have the jquery object in a variable, you can also just treat it as a normal indexed array, without the use of jquery:

var all_rows = $("tr");
for(var i=0; i < all_rows.length; i++){
   var row = all_rows[i];
   //additionally, you can use it again in a jquery selector
   $(row).css("background-color","black");
}

Although the above example is not useful in any way, it is representing how you can treat objects created by jquery as indexed arrays.

answered Sep 24, 2015 by gauravg.gwl

...