Electric Type

Multimedia

About Us

News

Help

NAME, ID, and CLASS in Dynamic HTML and JavaScript Image Arrays
by Taylor 5 Feb 1998


Page 1

Look through the source of many dynamic HTML pages, or pages that use the JavaScript array of images and links, and you'll notice that many of the tags have been given NAMEs, IDs, and CLASSes. While you might have correctly surmised that these are used as identifiers for other elements, stylesheets and server-side scripts, the differences between NAME, ID, and CLASS might seem a little fuzzy. When do you use ID instead of NAME? Should you just use CLASS for everything?

To answer these questions, I have a parable about everyone's favorite Active-Movie-Control-lovin' monkey, Shvatz.

I've known Shvatz for a long time. We went to school together and now work together. When people first hear his NAME, they often pause because it's weird. "Shvatz?" they ask, "How do you pronounce that?" (I always pull out my phoneme chart and give them a quick linguistics lesson.)

Of course, he's not Shvatz to everyone - especially teachers. They used to call him "Craig Adam Schwartz," because that was the name on his student ID. It is his official name after all. That's how he was named on the WANTED posters when the authorities were searching for him for behavior like streaking the quad or illegally cloning humans; the posters had his official ID and a description of him. His parents were embarrassed, but we thought he was cool.

next page»


Dynamic HTML  

Frames  

HTML Basics  

Stylesheets  

Tables  

XML  

Javascript  

Database Connections  

Intro To Perl  

HTML 4.0  

User Blogs

Screen Shots

Latest Updates

Contact Us

Valid HTML 4.01!
Valid CSS!

Breadcrumb

© ElectricType
Maintained by My-Hosts.com
Site map | Copyright | Disclaimer
Privacy policy | Acceptable Use Policy
Legal information.