Access Repeater values using JavaScript

前端 未结 2 1948
执笔经年
执笔经年 2021-01-16 12:52

i searched a lot on NET, to get the solution, but i could not find

Can anyone tell me how to access the label and textbox values of repeater control inside using th

2条回答
  •  失恋的感觉
    2021-01-16 13:25

    
    

    IDs must be unique, so you can't apply the same ID to all of the labels in your repeater. Use CSS class names instead.

    
    

    Since jQuery comes with .NET you can use it instead of plain JavaScript to access these elements more easily.

    var thisLabel = $('.myLabel').eq(0) where 0 is the index of the element since there can be many.

提交回复
热议问题