jQuery 101: Basic examples

Simple examples of selecting based on class and id of elements, binding a function to the click event, and changing css through jQuery.

JavaScript

var str ="Hi, Its stacks over flow and stackoverflow Rocks."

// It will check word from begginging to the end of the string
if(str.match(/(^|\W)stack($|\W)/)){
	alert('Word Match');
}else{
	alert('Word not found');
}