我想建立一個類似電子表格的應用程序,並使用表<td>
與標籤contenteditable = "true"
,我希望單元格的背景顏色在改變後被改變。contenteditable改變編輯後的背景顏色
從我的研究中我發現我需要javascript或jquery才能做到這一點,但我對此知之甚少。我從哪說起呢?到目前爲止,我已經想出瞭如何在編輯爲時更改顏色。謝謝!
<td contenteditable="true" >
<style>
[contenteditable="true"]:focus {
background-color: yellow;
}
</style>
"Stuff"
</td>
請檢查下面的例子。 – bhansa