My 2 cents: "You can still use name,...", yes, and you can use an attribute called "foobar", but that doesn't mean you should. Rob indicates"The name attribute is valid for many more elements" and then provides the full list, but I don't see DIV on that list anywhere.
According to the spec for HTML4 (which is where Rob's list comes from), DIV has the following attributes: coreattrs (id,class,style,title) i18n (lang,dir) Browsers are notoriously forgiving, so the burden of writing valid HTML falls on the developer (and it will make your JavaScript easier to debug). On Mar 12, 7:42 pm, Karl Rudd <karl.r...@gmail.com> wrote: > Quite right, I should have said: > > In general the "name" attribute is for form controls, rather than > general HTML elements. > > Karl Rudd > > On Fri, Mar 13, 2009 at 1:25 PM, RobG <rg...@iinet.net.au> wrote: > > > On Mar 13, 11:10 am, Karl Rudd <karl.r...@gmail.com> wrote: > >> Use id="whatever" rather than name="whatever". In CSS "#whatever" > >> refers to an element with id="whatever". > > >> The "name" attribute is for form elements, not for general elements. > > > The name attribute is valid for many more elements than just form > > elements (I guess you really meant form controls), the full list is: > > > button, textarea, applet, select, form, frame, iframe, img, a, > > input, object, map, param and meta > > > That's 9 out of 14 (64% or nearly 2/3) that *aren't* form controls or > > form elements. > > > -- > > Rob