The first difference is
An ID selector can be called only once in a document.
A class selector can be called multiple times in a document.
The second difference is
ID can be called by Javascript's getElementByID function.
Note1: There is no hard rule on when to use ID and when to use Class. Use class as much as possible for maximum flexibility, with the only exception being when you want to use Javascript's getElementByID function, in which case you need use ID.
Note2: Class and ID names are both case sensitive. For example, .divclass and .DivClass are two different classes.
Ajax to JSR 168 Portlets
-
Good article on *Best Practices for Applying AJAX to JSR 168 Portlets
http://developers.sun.com/portalserver/reference/techart/ajax-portlets.html*
0 Comments:
Post a Comment