Sheldon Livingston
asked on
How many elements using jquery and php
I have many <input> elements on my webpage.
Is there any way the jquery can tell me how many?
All the <input> elements have the id of theSameIDName.
Is there any way the jquery can tell me how many?
All the <input> elements have the id of theSameIDName.
ASKER
You most definetalty can have elements with the same name...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
jquery needs to be able to count elements... hopefully in a few years. Lame
To get the number of the elements use length:
Take this sample:
Open in new window
And the following javascript code:Open in new window
Open in new window
The first alert will display 2, but the second one will display 1