-1
是否可以選擇具有特定bgcolor的表並將其替換爲新表?替換HTML Dom對象中的表格
$ message是我的DOM對象,其中包含具有下表的HTML通訊。
<table width="100%" bgcolor="#EEEEEE">
some rows and columns
</table>
我想這與$ NEW_TABLE被替換,其中
$new_table = '<table width="100%" bgcolor="#EEEEEE">
new rows and columns
</table>';
我可以通過'$ old_table = $ dom-> getElementsByTagName('table') - > item(3); $ old_table-> parentNode-> removeChild($ old_table);'但不知道如何用$ new_table – AZee