开发者

Changing cell image from another cell textclick

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">&nbsp;</td> </tr> </table>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜