|
|||
Where is the difference between ID and CLASS?
hm I remember there is a thread about ID n CLASS here somehow it is lost (n i too lazy to dig it out), so i make a new thread here ask the same question again
![]() where is the difference between id n class? when to use id when to use class? i experimentally used them to hold several kind of properties n both of them works pretty well, cant see the different?? Last edited by kaisology : 21-03-2008 at 01:21 PM. |
|
||||
a very simple explanation for understanding:
--- ID is a unique and therefore can only exist only 1 time in a single html file. all the attribute that's being declare in css for ID can only be use for a single element. CLASS is the opposite of ID. All the attribute that's being declare in css for CLASS can be use multiple times on any html elements. --- that's the definition, both actually does work well and see no difference as u said but if u check with the web standard checker, those html which has 2 same ID in a single html will return error. That's for web standard ![]() and is better that u differentiate ID and CLASS properly as believe me, is very useful when u do some CSS modification in the future. "changing an ID attribute wont change anything else but changing CLASS attribute will affect others" hope my explanation is clear ![]()
__________________
Boonage - Freedom is Everything |
|
|||
|
|||
Quote:
Yipguseng has explain it well ![]() You can learn about AJAX in OpenDNS |
|
|||
For some reason, I can't even edit my own post!!!
Anyway, AJAX doesn't enhance Javascript. It relies on it. Javascript is a client side technology. It is purely run on the browser. AJAX can be thought of as interface between the technologies. AJAX just uses javascript to communicate with the server in the form of XML. That's all. There's no magical difference between javascript and AJAX, AJAX is an implementation of javascript. EDIT: the correct link is this: W3schools Last edited by Monie : 22-03-2008 at 05:48 PM. |
|
|||
Quote:
at least you give me some idea d |
|
||||
Javascript and AJAX is no different at all. That why i wonder after quite some time leaving for a short time World Wide Web and suddenly come back heard about AJAX/WEB 2.0 etc. Look at the coding and realised that it is the same Javascript with wide application use only. Long time ago has build this kind of code. Just never give a name for it..haha
|
|
||||
What being said from the first reply is true. Id should be unique in per page, i.e can only be use once. Where as class can be use repetitively.
Some might not see the importance of this, as they tend to use id instead of class again and again. As for me, I followed this rule strictly since I'm using jQuery, a javascript framework for my works. On events such as, click, submit, etc, jQuery heavily depending on id and classes. I believe for those who work a lot with Javascript, to say the least, would see the importance in differentiating id and class.
__________________
""If you must break the law, do it to seize power: in all other cases observe it." - Julius Caesar |
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Spotlight: A class of many languages | genzy | Mamak Stall | 2 | 06-07-2007 02:57 AM |
| what is the difference between trackback and ping? | ladyfiesta | Blogging Discussion | 3 | 09-05-2007 03:59 AM |
| Multiple database class | hajime | Website Programming | 4 | 02-09-2004 02:58 PM |
| Class | nurulmajdi | Website Programming | 10 | 15-04-2004 12:03 AM |
| What's the difference between Flash and Director | zaimlah | Website Design | 12 | 18-02-2004 12:00 AM |
All times are GMT +8. The time now is 03:09 PM.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.












yes clear enough!!!

what role they r playing in ajax?
at least you give me some idea d
Linear Mode

