小弟对js还不太熟想问一下比如代码
<table width="94%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#97aa9f">
<tr>
<th width="11%" height="27" align="center" ><?php echo $SETTING['DISK_NO.'];?></th>
<th width="9%" height="27" align="center" ><?php echo $SETTING['TOTAL_SPACE'];?></th>
<th width="11%" height="27" align="center" ><?php echo $SETTING['USER_SPACE'];?></th>
<th width="11%" height="27" align="center" ><?php echo $SETTING['USER_RATIO'];?></th>
</tr> <tr>
<div id="SYSTEM_MESSAGE">
</div>
</tr>
</table>怎么用JS来在ID=SYSTEM_MESSAGE 的地方生成一下代码呢?
<td height="25" align="center" bgcolor="#ECF0F0"></td>
<td align="center" bgcolor="#ECF0F0"></td>
<td align="center" bgcolor="#ECF0F0"></td>
<td align="center" bgcolor="#ECF0F0"></td>
不通过div的标签也可以只要在<tr></tr>标签中间生成就可以了,最好的办法是什么,请各位高手帮帮忙
<table width="94%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#97aa9f">
<tr>
<th width="11%" height="27" align="center" ><?php echo $SETTING['DISK_NO.'];?></th>
<th width="9%" height="27" align="center" ><?php echo $SETTING['TOTAL_SPACE'];?></th>
<th width="11%" height="27" align="center" ><?php echo $SETTING['USER_SPACE'];?></th>
<th width="11%" height="27" align="center" ><?php echo $SETTING['USER_RATIO'];?></th>
</tr> <tr>
<div id="SYSTEM_MESSAGE">
</div>
</tr>
</table>怎么用JS来在ID=SYSTEM_MESSAGE 的地方生成一下代码呢?
<td height="25" align="center" bgcolor="#ECF0F0"></td>
<td align="center" bgcolor="#ECF0F0"></td>
<td align="center" bgcolor="#ECF0F0"></td>
<td align="center" bgcolor="#ECF0F0"></td>
不通过div的标签也可以只要在<tr></tr>标签中间生成就可以了,最好的办法是什么,请各位高手帮帮忙
解决方案 »
- 怎么才能把自己的js文件输出成这样的js文件呢
- IE和Firefox中回车响应
- jquery问题
- 求一匹配空值或11位数字的正则!
- dhtmlxTree moveItem的问题,为什么 使用moveItem 报错,this._lastChild is not a function
- 求一个js例子实现屏幕上的一张图片在鼠标点击屏幕上一点后图片移动到那点,类似于游戏中人物的移动(最好有动作的,用js怎么实现?)
- 200分请梅花雪解决有关MzTreeView1.0的问题~
- XMLHttpRequest的问题!
- 求大神指点一下
- 事件处理函数的参数是哪里来的
- 关于js判断日期的问题不兼容
- 很纠结的问题!(Firfox下js调用方法)
document.getElementById("SYSTEM_MESSAGE").outerHTML = 你的变量
<table width="94%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#97aa9f">
<tr>
<th width="11%" height="27" align="center" ><?php echo $SETTING['DISK_NO.'];?></th>
<th width="9%" height="27" align="center" ><?php echo $SETTING['TOTAL_SPACE'];?></th>
<th width="11%" height="27" align="center" ><?php echo $SETTING['USER_SPACE'];?></th>
<th width="11%" height="27" align="center" ><?php echo $SETTING['USER_RATIO'];?></th>
</tr>
</table>
<script type="text/jscript">
function addRow(){
var tab=document.getElementsByTagName("table")[0];
var row=tab.insertRow();
for(var i=0;i<4;i++){
var cell=row.insertCell();
if(i==0)cell.setAttribute("height","25");
cell.setAttribute("align","center");
cell.setAttribute("bgcolor","ECF0F0");
}
}
</script>
http://jquery-api-zh-cn.googlecode.com/svn/trunk/xml/jqueryapi.xml
<script type="text/javascript">
var TD0=document.getElementsByTagName("td").item(0);
var TD1=document.getElementsByTagName("td").item(1);
var TD2=document.getElementsByTagName("td").item(2);
var TD3=document.getElementsByTagName("td").item(3);
<script/>