1,onchange
应该可以的
with(document.frm.sele)
{
onchange=...
}
2,看例子
ob.onblur=new Function("show(this)");<form name=show>
<input type="text" name=a>
</form>
<script>
function init(form)
{
for(var m=0;m<form.elements.length;m++){
var ob=form.elements[m];
if(ob.type=="text"){
ob.onblur=new Function("show(this)");
}
}
}function show(obj){
alert(obj.name+"="+obj.value);
}
init(document.show);
</script>
3,定义数组
var cities=new Array();

解决方案 »

  1.   

    3,var mystr=new String("mystr");
      

  2.   

    谢谢你, seabell(百合心) 
    <BODY>
    <select name=sele id=sele1 onchange="ck();"><option>1<option>2<option>3</select>
    <input type=button name=butt1 onclick="ck1();">
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    var ob=document.all.sele;
    function ck()
    {
    with(ob)
    {
    ob.onchange=new Function("ck1()");
    //this.onchage;
    }
    }
    ck();
    function ck1()
    {
    alert('123');
    }
    //-->
    </SCRIPT>
    我把代码改成var ob=document.all.sele;
    with(ob) {...}
    可以
     为什么直接with(document.all.sele)
    就没有反应。。
    还有一个问题;关于new Function()
    那个function 已经写好了,为什么要new一下,我不明白new 的意义在哪?
    还有就是我没有办法动态生成function ,换句话说,我按了一个按钮,产生一个function,在这之前,就没有这个function..
    我的这个思路是不是无法实现。。谢谢! 我很快就给分。
      

  3.   

    谢谢你,  seabell(百合心)    
     <BODY  >  
     <select  name=sele  id=sele1  onchange=  "ck();  "  >  <option  >1  <option  >2  <option  >3  </select  >  
     <input  type=button  name=butt1  onclick=  "ck1();  "  >  
     <SCRIPT  LANGUAGE=  "JavaScript  "  >  
     <!--  
    var  ob=document.all.sele;  
    function  ck()  
    {  
    with(ob)  
    {  
    ob.onchange=new  Function(  "ck1()  ");  
    //this.onchage;  
    }  
    }  
    ck();  
    function  ck1()  
    {  
    alert('123');  
    }  
    //--  >  
     </SCRIPT  >  
    我把代码改成var  ob=document.all.sele;  
    with(ob)  {...}  
    可以  
     为什么直接with(document.all.sele)  
    就没有反应。。  
     
     
    还有一个问题;关于new  Function()  
    那个function  已经写好了,为什么要new一下,我不明白new  的意义在哪?  
    还有就是我没有办法动态生成function  ,换句话说,我按了一个按钮,产生一个function,在这之前,就没有这个function..  
    我的这个思路是不是无法实现。。  
     
    谢谢!  我很快就给分。