jQuery Plugins
By: Darren Mason

Custom Selectbox
Custom Radio and Checkboxs
Password Strength Indicator


Miscellaneous jQuery Code:

Text Highlighter

Lorem ipsum myTerm dolor sit amet, consectetur adipiscing elit. Aliquam at risus sit amet diam rhoncus condimentum ac ut quam. Cras ut leo et sem mollis myTerm porta. Aliquam ornare ante velit, a elementum lorem. Nulla mattis velit eget ligula mollis ultricies suscipit mi laoreet. Phasellus non massa at est molestie dapibus vitae et erat. Vestibulum myTerm et placerat massa. Vivamus feugiat sagittis gravida. Maecenas in malesuada lacus. Aliquam erat volutpat.
//Attach highlight to any text you want to highlight a single word in.
$("#myText").highlight("myTerm","myClassName");

$.fn.highlight = function (what, className) {

	return this.each(function () {

		$.fn.doHighlight = function (searchText, searchTerm, className) {
			var newText = "", i = -1;

			while (searchText.length > 0) {
				i = searchText.toLowerCase().indexOf(searchTerm.toLowerCase(), i + 1);
				if (i < 0) {
					newText += searchText;
					searchText = "";
				} else {
					// skip anything inside an HTML tag
					if (searchText.lastIndexOf(">", i) >= searchText.lastIndexOf("<", i)) {
						newText += searchText.substring(0, i) + ""
								+ searchText.substr(i, searchTerm.length) + "";
						searchText = searchText.substr(i + searchTerm.length);
						i = -1;
					}
				}
			}

			return newText;
		};

		var textArea = this.innerHTML, searchArray = what.split(" ");

		for ( var i = 0; i < searchArray.length; i++) {
			textArea = $.fn.doHighlight(textArea, searchArray[i], className);
		}

		this.innerHTML = textArea;
	});
}