javascript - Jquery get nth child of a matched row -
please see line prepend below.
$('#area_code').keyup(function(){ var searchterm = $(this).val(); if(searchterm.length > 3) { var match = $('tr.data-row:contains("' + searchterm + '")'); var nomatch = $('tr.data-row:not(:contains("' + searchterm + '"))'); $('#sector1_result').prepend(match) match.addclass('selected'); nomatch.css("display", "none"); } else { $('tr.data-row').css("display", ""); $('tr.data-row').removeclass('selected'); } });
this gets row table , appends it, want cell row , not entire row.
you can use combination of .children
, .get
or .eq
. example if match
jquery object containing row, nth child whith:
match.children().get(n)
Comments
Post a Comment