基本控件的使用

 

控件名.value

控件名.value

控件名[i].checked    .value 

for each ob in控件名
   if ob.checked then
      window.alert ob.value
next

控件名.checked    .value

Select 1Select 3Select 2Select 1Select 2Select 3Select 4Select 1Select 2Select 3Select 4
 
  
单行         多行         多选

添加选项

ExpList.add(new Option("New Option","3"));

删除选项

ExpList.remove(ExpList.selectedIndex);

设置当前选项位置

ExpList.selectedIndex=ExpList.length-1;

循环整个选项
并判断是否被选择

for(i=0;i<ExpList.options.length;i++) {
  if(ExpList.options[i].selected){
     //ExpList.options[i].text;
     //ExpList.options[i].value;
  }
}

单个选项的值

ExpList.options[i].text;
ExpList.options[i].value;
<span id="SomePlace1"></span>
<div id="SomePlace1"></div>

重新设计包含的html

SomePlace1.innerHTML="任意html字符串"

让该空间的内容消失

SomePlace1.style.display="none";

让该空间的内容显示

SomePlace1.style.display="block";

鼠标滑过出现提示title="Help"

<input type="hidden" name="MyValueName" value="123">

控件名.value
跟随事件Event(声明方式特殊)<div id=hello1 style=position:absolute>太过分了!吃饭不叫我</div>
<SCRIPT for=document EVENT=onmousemove>
document_onmousemove();
function document_onmousemove() {
  hello1.style.left=event.x+10;
  hello1.style.top=event.y+10;
}
</SCRIPT>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值