html中搞了几个文本框,然后js中通过变量把文本框中手工输入的值取过来,一直不成功。
下面是html的代码,要引用的是J0的value(都是阿拉伯数字)
<table id="bg2" border="0" cellpadding="0" cellspacing="0" style="margin: 0px;background-color: #800000;">
<tr>
<td id="selftable" class="attribute" width="280">
<table class="table1" border="1" cellpadding="0" cellspacing="0" bordercolor="#0079C2" height="160" width="280">
<tr >
<td width="50" height="20"><span style="color:#0F0">姓名</span></td>
<td width="85" height="20">
<span><input type="text" class="Input" id="X" size="8" style="width: 80px; height: 20px; font-size: 13pt; font-weight: 400; text-align:center;background-color:#EEEEEE" value="" name="X"></span>
</td>
<td width="50" height="20"><span style="color:#0F0">专属</span></td>
<td width="50" height="20"><span style="color:#0F0">策略</span></td>
</tr>
<tr>
<td width="50" height="20"><span>生命</span></td>
<td id="X0" width="85" height="20"><span>0/0</span></td>
<td id="A0" width="85" height="20"><span >0</span></td>
<td width="85" height="20">
<span><input type="text" class="Input" id="J0" size="8" style="width: 80px; height: 20px; font-size: 13pt; font-weight: 400; text-align:center;background-color:#EEEEEE" value="0" name="J0"></span>
</td>
</tr>
下面是js的代码,通过cj0变量来引用,一直不成功。求帮忙指点!
var cJ0 =0;
cj0 =document.getElementById('J0').value;