Okay to Exclude both Name and ID?

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.
 
K

Kevin Spencer

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
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top