我在这里有两个条件可以在更改功能上重置表格中的图像,但我希望将具有 browbandtable 类的图像重新设置为 browbandtable1 的不同图像。
这是表格,我有两页,一页有 browbandtable,这一页有 browbandtable1。我将如何对其进行编码,以便仅在类匹配时才使用该代码?
任何帮助将不胜感激
<div id="black1">
<table width="400" height="100" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<th align="center" id="img1" scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img2" scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img3" scope="col" ><img class="browbandtable1"src="images/none1.png"width='18' height='18'></th>
<th align="center" id="img4" scope="col" ><img class="browbandtable1"src="images/none1.png"width='18' height='18'></th>
<th align="center" id="img5" scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img6"scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img7"scope="col" ><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img8"scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img9"scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img10"scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img11"scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img12"scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img13"scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img14"scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img15"scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img16"scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img17"scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th>
<th align="center" id="img18"scope="col"><img class="browbandtable1"src="images/none1.png" width='18' height='18'></th> </tr>
</table></div>
//查询代码
$("[id^='img']").append('<img class="browbandtable" src="images/none.png" width="40" height="39">');
$("[id^='img']").append('<img class="browbandtable1" src="images/none1.png" width="18" height="18">');