About Me

Agus Haryanto,
Android Trainner,
GoogleMaps (JavaScript) Trainer
JQuery and JQuery Mobile Trainer
Java, Java Script and PHP Trainer
Freelance Developer Android
Freelance Developer Blackberry
Freelance Developer Web (GIS Googlemaps)
Freelance Developer SMS Gateway

jika ingin contact saya bisa emali ke agus.superwriter@gmail.com

ym: agus_h23

Pin BB : 2AD38B33

Facebook : Agus Haryanto


Article

Mengenal Selector JQuery Basic Filter (:last)

matches the last selected element.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <script src="../jquery-latest.js"></script>

  <script>
  $(document).ready(function(){
    $("tr:last").css({backgroundColor: 'yellow', fontWeight: 'bolder'});
  });
  </script>

</head>
<body>
  <table>
    <tr><td>First Row</td></tr>
    <tr><td>Middle Row</td></tr>
    <tr><td>Last Row</td></tr>
  </table>
</body>
</html>

Perintah

$(“tr:last”).css({backgroundColor: ‘yellow’, fontWeight: ‘bolder’});

digunakan untuk menset css backgroundColor: ‘yellow’, fontWeight: ‘bolder’ pada tr paling akhir suatu table yang ada di document HTML. Jadi walaupun banyak tr dalam table hanya tr paling akhir yang diset cssnya. Sedangkan tr-tr lainnya tidak.

Share

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam protection by WP Captcha-Free