<script type=”text/javascript”> $(document).ready(function() { var jq = $(‘label’); jq.slice(0, 2).css(“border”, “thick double black”); jq.slice(4).css(“border”, “thick solid red”); }); </script> …


One thought on “jquery

  1. $(document).ready(function() { // remove elements whose src attribute contains the letter ‘s’ $(‘img’).filter(‘[src*=s]’).css(“border”, “thick double red”); // remove elements that don’t contain the letter p var jq = $(‘[for*=p]’); $(‘label’).filter(jq).css(“color”, “blue”); // remove elements that are not the specified element var elem = document.getElementsByTagName(“label”)[1]; $(‘label’).filter(elem).css(“font-size”, “1.5em”); // remove elements using a function $(‘img’).filter(function(index) { return this.getAttribute(“src”) == “peony.png” || index == 4; }).css(“border”, “thick solid red”) });

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s