“penyaringan jQuery” Kode Jawaban

JQuery - Filter

<script>
$(document).ready(function(){
  $("#myInput").on("keyup", function() {
    var value = $(this).val().toLowerCase();
    $("#myTable tr").filter(function() {
      $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
    });
  });
});
</script>
Smiling Sardine

penyaringan jQuery

//first()
$(document).ready(function(){
  $("div").first();
});

//last()
$(document).ready(function(){
  $("div").last();
});

//eq()
$(document).ready(function(){
  $("p").eq(1);
});

//filter()
$(document).ready(function(){
  $("p").filter(".intro");
});

//not()
$(document).ready(function(){
  $("p").not(".intro");
});
naly moslih

menyaring jQuery

$("span strong").first();   // first strong in first span
$("span strong").last();    // last strong in last span
$("div").eq(9);             // element with a specific index
$("div").filter(".big");    // all div elements with .big class
$("div").not(".big");       // opposite of filter
BlueMoon

Jawaban yang mirip dengan “penyaringan jQuery”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya