.addClass( className ) :- Adds the specified class(es) to each of the set of matched elements

.addClass() method is used to add class to some elements.

Example :-


.myclass { color:red; font-size:25px; }

.paragraph { color:blue; font-size:20px; }


<script type=”text/javascript” src=”http://code.jquery.com/jquery-1.5.js”></script&gt;

<script type=”text/javascript”>

$(document).ready(function (){





<div align=”center”>I am div1</div>

<p align=”center”>I am paragraph</div>

<div align=”center”>I am div2</div>

Output :-

.add( selector ) :- Add elements to the set of matched elements

add() method is used to assign some property to some elements .

<script src=”http://code.jquery.com/jquery-1.5.js”></script&gt;
<p>I am just a paragraph</p>
<span id=”a”>I am span</span>
$(“p”).add(document.getElementById(“a”)).css(“background”, “yellow”).css(“font-size”, “25px”);

Output :-

Add elements to the set of matched elements

.each( function(index, Element) ) :- execute for each matched element

It will Iterate over a jQuery object, executing a function for each matched element.

When we need to apply some index number to some elements iteratively, we can assign it using .each method. This method is useful when we need to assign some common property to number of repeated divs or list.

Example :-

<script type=”text/javascript” src=”jquery.js”></script>
<script type=”text/javascript”>
$(‘li‘).each(function(number) {
alert(number + ‘: ‘ + $(this).text());});

Output :-

0: Monday
1: Tuesday
2: Wednesday

This method assign index number starting from 0 to number of elements.

Show and Hide div on radio button click using JavaScript & jQuery

There are certain cases when you need to hide & show divs on basis of some click event ! Here is one of the basic usage of JavaScript & jQuery to show & hide divs on click of radio buttons.

Checkout in action Down pointing backhand index

Checkout above video for step by step guide for both native JavaScript and jQuery code.

https://www.youtube.com/c/CodeCanvas/ – Please checkout my YouTube channel and subscribe for more technical videos and tutorials.

Please leave your comments , if you found above code useful. so , I can improve it from your suggestions.

jQuery Rounded Corners CSS

If you are looking for Corner in html..

No need to wondering at all..

Try this using jquery..It includes most of all corners you need..