易截截图软件、单文件、免安装、纯绿色、仅160KB

JavaScript获取选中项

<script type="text/javascript">
function show(){
var ListUtil=new Object();
var ListUtil.getSelectedIndexes=function (oListbox){
var arrIndexes=new Array;
for(var i=0;i <oListbox.length;i++){
  if(oListbox.options[i].selected){
  arrIndexes.push[i];
  }
  }
  return arrIndexes;
};
var oListbox=document.getElementById("selAge");
var arrIndexes=ListUtil.getSelectedIndexes(oListbox);
alert("There are"+arrIndexes.length+"option selected."+"The options have the indexes"+arrIndexes+".");
}
</script>
</head>

<body onload="show()">
<select name="selAge" id="selAge" size="3" multiple="multiple">
  <option value="1" >18-21 </option>
  <option value="2" selected="selected">22-25 </option>

  <option value="3" selected="selected">26-29 </option>
  <option value="4">30-35 </option>
  <option value="5">Over 35 </option>
</select>
</body>这段代码怎么报错missing:before statement和show
is not defined


相关问答:

IE7浏览器下为何不能运行flash和Javascript?

我家电脑原来装的是IE7浏览器,但是最近我爸爸动了某个配置,导致IE7环境下不能运行flash和javascript,看sina或者其他新闻网站上都是一块一块空白,登陆twitter也不成功,报:由于不支持javascript,导致不能登陆。 ......

javascript 找不到错误

<script type="text/javascript">
    function IsValidate()
    {
        var flag=false;
        var cellPartN ......

如何使用JavaScript改变struts的bean write的值

页面载入的时候使用 如下代码取得一个属性并显示在jsp中
Java code:

<td id="temp1">
<bean:write name="Form" property="years" scope="request"/>
......

javascript中是值是怎么交换了? - Java / Java相关

三个数x,y,z 比大小..
var x,y,z,t;
if (x>y) 
{t=x;x=y;y=t;} //交换x,y的值 
if(x>z) 
{t=z;z=x;x=t;}//交换x,z的值 
if(y>z) 
{t=y;y=z;z=t;}//交换z,y的值
这是 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号