Okay to Exclude both Name and ID?

  • Thread starter Thread starter Guadala Harry
  • Start date Start date
G

Guadala Harry

I'm dynamically building an HTML <table> that has a bunch of rows - each of
which presents read-only data in DIVs.

Just wondering if it's okay to omit both the Name and Id attribute of the
DIV tags in the table - or if there is some good reason why I should go to
the effort to create a unique Name or Id value for each (which would also
increase processing time and render more verbose html). Given that I have no
client- nor server-side code that references the DIVs, I might as well keep
things simpler. But my concern is that there might be some "gotcha" lurking
if I do this... perhaps some browsers wouldn't like it... Any thoughts on
this?

Thanks.
 
Good question, GMan,

The ID is used to get a handle on Controls that you need to work with. The
Name attribute is for the client. So, assuming that you don't need to
manipulate your Controls on either server or client-side, you would have no
other need for these properties to be set.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
div's do not support a name attribute. the id attribute is optional, but if
used should be unique and follow the w3c naming conventions (asp.net breaks
this rule).

-- bruce (sqlwork.com)
 
Back
Top