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 (:not)

Filters out all elements matching the given selector.

<!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(){

    $("input:not(:checked) + span").css("background-color", "yellow");
    $("input").attr("disabled", "disabled");

  });
  </script>

</head>
<body>
  <div>
    <input type="checkbox" name="a" />
    <span>Mary</span>
  </div>
  <div>
    <input type="checkbox" name="b" />
    <span>Paul</span>
  </div>
  <div>
    <input type="checkbox" name="c" checked="checked" />
    <span>Peter</span>
  </div>
</body>
</html>

Perintah

$(“input:not(:checked) + span”).css(“background-color”, “yellow”);

digunakan untuk menset css backgroundColor: ‘yellow’ pada input checkbox yang tidak tercheck yang ada di document HTML.

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