document.getElementById("inputID").value="new"

解决方案 »

  1.   

    当然 ,方法还有很多,如 
    document.formName.inputName.value="new"
      

  2.   

    可是我这么用了之后input的值并没有改变为什么啊?
    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>无标题页</title>
    </head>
    <body >     <form id="form1" runat="server">
        
        
            &nbsp;<input id="text1" name="text1" type="text" />
       
        </form>
        <script language="javascript" type="text/javascript">
        
            document.getElementById("text1").Value="123";     
         </script>
    </body></html>