如何将datalist值传递给jquery函数 [英] how to pass the datalist value to jquery function
本文介绍了如何将datalist值传递给jquery函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个datalist,datalist包含一个linkbutton和一些带值的控件,如何通过javascript函数传递datalist的值来自linkbutton
Hi ,
I having a datalist ,the datalist contains one linkbutton and some controls with values ,how to pass the values of datalist throug javascript function that function cal from linkbutton
推荐答案
基本理念和是===是正确的
Basic idea and yes === is correct
var arr = [];
var foo = document.getElementById("<%= MyDataList.ClientID %>");
var inps = foo.getElementsByTagName("input");//control declaration in the datalist
for(var i=0;i<inps.length;i++){
arr.push(inps[i].value);
//and just add some code again
}
您可能需要更改MyDataList
You might have to change MyDataList
这篇关于如何将datalist值传递给jquery函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文