只清除某一文本框的内容?document.all.文本框的name/id.value=""

解决方案 »

  1.   

    <input id="a1" value="123">
    <button onclick="a1.value=''">Clear</button>
      

  2.   

    直接把值给为空,好象不可以也!
    另外document.form1.a1.value="";
    为什么没有作用?
      

  3.   

    document.form1.a1
    和document.all.a1
    有什么不同?
      

  4.   

    <form name=form1>
    <input id="a1" value="123">
    <button onclick="document.form1.a1.value=''">Clear</button>
    <form>or
    ====<form name=form1>
    <input id="a1" value="123">
    <button onclick="document.all.a1.value=''">Clear</button>
    <form>