shall we assign numbers as textbox ID ?
or any rules to assign ID to text box ?
[RESOLVED] doubt
Moderator: General Moderators
[RESOLVED] doubt
Last edited by vinoth on Wed Sep 05, 2007 8:11 am, edited 1 time in total.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
IDs are meant to be either descriptive or as a way of differentiating between elements. There are no "rules" really, only that they are manageable.
When it comes to multiple elements of the same type, if they are related, you can always used getElementsByTagName and filter them by className and such.
When it comes to multiple elements of the same type, if they are related, you can always used getElementsByTagName and filter them by className and such.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
ya I assign the id as numbers alone its working
because I print 5 text box dy using for loop
because I print 5 text box dy using for loop
Code: Select all
(for $i=0;$i<5;$i++)
{
echo "<input type='text' id='$i'>
}