<label value="" name="" id="LabelID">xxxx</label>脚本访问LabelID.innerText就是"xxxx"了.

解决方案 »

  1.   

    下面是文本框
    <input type=text style="border:1px solid">
    <br>
    <input type=text style="border:0px solid">
      

  2.   

    <style>
    .txtCustom1 {  
    height: 20px; 
    width: 100px; 
    border-color: #000000; 
    border-top-width: 0px; 
    border-right-width: 0px; 
    border-bottom-width: 0px; 
    border-left-width: 0px; 
    font-size: 9pt; 
    background-color: #FFFFFF; 
    color: #000000
    }
    .txtCustom2 {  
    height: 20px; 
    width: 100px; 
    border-color: #000000; 
    border-top-width: 1px; 
    border-right-width: 1px; 
    border-bottom-width: 1px; 
    border-left-width: 1px; 
    font-size: 9pt; 
    background-color: #FFFFFF; 
    color: #000000
    }</style>
    <table border=1>
    <tr align=center><td>
    <INPUT type="text" name="txt1" value="现有数量" size=10 readOnly class="txtCustom1">
    </td>
    <td>
    <INPUT type="text" name="txt2" value="领出数量" size=10 readOnly class="txtCustom1">
    </td></tr>
    <tr><td>
    <INPUT type="text" name="txt3" value="50" size=10  class="txtCustom2">
    </td>
    <td>
    <INPUT type="text" name="txt4" title="请输入领出量" size=10  class="txtCustom2">
    </td></tr>
    <tr> <td  colspan=2 align="center">
    <input type=button name="confirm" value="确定" onclick="alert (txt3.value)">
    </td></tr>
    </table>
      

  3.   

    多谢。请问可以像表单一样传递label变量到下一个action页面吗?
    马上给分!
      

  4.   

    label 不能把值通过提交的方法传递到下一个页面 ,你可以用text 或hidden等方式 记录它再传值