jQuery clear form function

  [code lang="js"] $.fn.clearForm = function() { return this.each(function() { var type = this.type, tag = this.tagName.toLowerCase(); if (tag == 'form') return $(':input',this).clearForm(); if (type == 'text' || type == 'password' || tag == 'textarea') this.value = ''; else if (type == 'checkbox' || type == 'radio') this.checked = false; else if (tag == 'select') this.selectedIndex = -1; }); }; [/code] How to use: $("#formID").clearForm();

14/01/2015

how to keep lates jquery between head tags

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>


14/01/2015

a list of jquery function

[code lang="js"]$("span").text(arr.join(", ")); .change(); $("div:contains('John')").css("text-decoration", "underline"); $("div").slideDown("slow"); $("div").slideUp(); $('li').not(':even').css('background-color', 'red'); $('li.item-a').parent().css('background-color', 'red'); $(this).css("border", "2px red inset").filter(".middle").css("background", "yellow").focus(); $("div").css("background", "#b4b0da").filter(function (index) { return index == 1 || $(this).attr("id") == "fourth"; }) .css("border", "3px double red");</pre> [/code]

14/01/2015