问题描述
我正在将javascript用于我的应用程序中的一个ascx控件.
ascx控件在面板内具有复选框列表.我有一个javascript函数来处理复选框列表项的onclick.
我正在尝试将复选框列表作为
var checkBoxList = document.getElementById(<%= CheckBoxList1.ClientID%>");
->它给复选框列表为空;也尝试过,
var checkBoxList = document.getElementById("CheckBoxList1");
如果该值也为null.
I am using javascript for one of the ascx controls in my application.
The ascx controls have checkbox lists inside a panel. I have a javascript function to handle the onclick of checkboxlist items.
I am trying to get the checkbox list as
var checkBoxList = document.getElementById("<%= CheckBoxList1.ClientID %>");
--> it gives checkbox list as null; Also trying with,
var checkBoxList = document.getElementById("CheckBoxList1");
hen also the value is null.
How can I get the checkboxlist item here?
推荐答案
这篇关于无法使用javascript获取复选框列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!