已知select 中有和1项和name3相同的值得
var tr=document.elementFromPoint(event.x,event.y).parentNode.parentNode;
var name3= tr.childNodes[3].innerText ;
var SelectSF=document.getElementById("Select_SF");
for(var i=0;i<SelectSF.options.length;i++)
{
if(SelectSF.options[i].value== name3)
{
SelectS[i].selected=true;
alert("ok");
break;
}
}
请问为什么这样不行,判断到if处就跳出,
还有我将这样测试也不行
var name3= "aaa" ; //SelectSF.options[2].value我指定了一个值也是"aaa"
var SelectSF=document.getElementById("Select_SF");
for(var i=0;i<SelectSF.options.length;i++)
{
if(SelectSF.options[2].innerText== name3)
{
SelectS[2].selected=true;
alert("ok");
break;
}
}
象这样测试也不行,不知道问题出那了,请高手看看
var tr=document.elementFromPoint(event.x,event.y).parentNode.parentNode;
var name3= tr.childNodes[3].innerText ;
var SelectSF=document.getElementById("Select_SF");
for(var i=0;i<SelectSF.options.length;i++)
{
if(SelectSF.options[i].value== name3)
{
SelectS[i].selected=true;
alert("ok");
break;
}
}
请问为什么这样不行,判断到if处就跳出,
还有我将这样测试也不行
var name3= "aaa" ; //SelectSF.options[2].value我指定了一个值也是"aaa"
var SelectSF=document.getElementById("Select_SF");
for(var i=0;i<SelectSF.options.length;i++)
{
if(SelectSF.options[2].innerText== name3)
{
SelectS[2].selected=true;
alert("ok");
break;
}
}
象这样测试也不行,不知道问题出那了,请高手看看
解决方案 »
- 菜鸟请教:如何实现每点击按钮一次,使得label显示数字加一,谢谢
- 【100分 图片菜单】各位老大,在.net中如何做一个支持代替图片的菜单?
- 关于NameValueCollection和Headers
- eWebEditor在线编辑器在formview的编辑模版EditItemTemplate中如何取值
- 怎么会出现这个问题?
- 菜鸟求助各位大大,关于多行多列的问题!
- 为什么用select top 5 但还是读出了全部记录
- 自定义控件中的图片问题
- 弱弱的问,页面运行时数据控件不显示,?
- 简单问题,xxx.ASPX页面调用styles.css文件没有起到作用,帮我看看错误!!多谢!
- 数据访问时如何写效率会高点?
- CheckBox在gridview中的 全选 事件 (怎么用js搞定)
SelectSF.options[i]始终都没取到值
查了质料 但他们也都这么写 但我就是取不到