加个selected
<OPTION value="1" selected>sdff</OPTION>
<OPTION value="1" selected>sdff</OPTION>
解决方案 »
- qq登录后获得openid失败
- html实现页面传值
- 求前台(Ext或者javaScript)高手写一个特效.在线等
- html中出生日期内容在输入身份证号码后自动生成,与身份证号一一对应,不能单独修改
- 给js赋值问题
- 复选框问题。
- 输入文本的对话框 在javascript怎么写?
- 怎样让代码看不见?这个网站http://www.treemenu.com/左边树(代码看不到)怎样实现?
- 请教:一个gif图(或其他图)在网页里,我怎知道它缺省是显示的高度和宽度是多少呢?
- getElementById取不到百度按钮的id
- 怎样制作例如 http://www.tunnel.net.cn/oa.gif左边的导航菜单
- 散分1000,分太多郁闷ing
<%
for i=1960 to 2005
response.Write "<option value="&i&">"&i&"</option>"
next
%>
</select>SIZE=1,所以SELECT框一次只会显示一条数据,在SELECT框右边会出现一个上下前头进行选择。就是如果,当被选择后的数据显示在SELECT框里,然后自动被选中。不用在单击它。大家试一下,帮帮我,,,急~~~~~~~
<%
for i=1960 to 2005
response.Write "<option value="&i&">"&i&"</option>"
next
%>
</select>
<script>
function setSelected(w) {
var getyear_mm=document.all.year_mm.options;
for(i=0;i<getyear_mm.length;i++)
getyear_mm(i).selected=w;
}
</script>点击就能把所有的option选中.
但是你那样做,就把所有值全都选择完了。我只要自动选择显示在当前SELECT框里的值。仅仅一个值。该怎么样做呢?
<%
for i=1960 to 2005
response.Write "<option value="&i&">"&i&"</option>"
next
%>
</select>
<input type=button name="submit" value="<"
onmousedown="timer1=setInterval('selectProv()',100)"
onmouseup="clearInterval(timer1)">
<input type=button name="submit" value=">"
onmousedown="timer2=setInterval('selectNext()',100)"
onmouseup="clearInterval(timer2)">
<script>
function selectNext() {
n=document.all.year_mm.options.length;
i=document.all.year_mm.selectedIndex;
i++;
if(i<n) document.all.year_mm.selectedIndex=i;
}function selectProv() {
n=document.all.year_mm.options.length;
i=document.all.year_mm.selectedIndex;
i--;
if(i>=0) document.all.year_mm.selectedIndex=i;
}
</script>
让我今天加班感觉很温暖...
~~