Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Friends..

when I apply Javascript in each row of datalist,it apply only on first row of datalist while others rows are remaing static.

why this happen?

Any Solution that i apply Javascript in each row of datalist?
Posted

1 solution

i don't know if i understood well the problem, anyway i give some hint that could be usefull

you'r using a getElementById ?

that should be why you get only one element.

i suggest you using jquery to get the collection of items that you need to manipulate.

a lot of stuff can be founded here http://jquery.com/[^]

ex :
HTML
<a id="test" class="classTest">text</a>


you can get the element by $('#test'), or every element with the same class as $('.classTest')

in the second case then you can loop foreach element and do what you need
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900