HI i have created table in 开发者_JS百科HTML from one cell of that table i want to change another cell image or text how its possible ?
in your head section you need to put little css code as
<style type="text/css">
.turnitred {
text-align:center;
background-color:white;
}
</style>
and your td, the one you want to change the colour should have an id and that style you gave on above style text... on click change the bg of the td with according id for example:
<table width="200" border="1">
<tr>
<td width="94"><div class="turnitred" onclick ="changebg.style.backgroundColor='#ff0000'">Turn it red</div></td>
<td width="90" id="changebg"> </td>
</tr>
</table>
精彩评论