I was developing a spreadsheet editor. When I was editing a specific cell in the table, how can I change the cell's font size?
I used getElementById
Code here:
<title>Gold Sheets</title>
<div id="toolbar">
<select name='Font Size' id="ft_size" onchange="changeSize(this);">
<option value="12">12</option>
<option value="14">14</option>
<option value="16" selected>16</option>
<option value="18">18</option>
<option value="24">24</option>
</select>
</div>
<script>
function changeSize(e) {
document.getElementById('textarea').style.fontSize = e.value + 'px'
}
</script>
<br>
<br>
<table>
<tr>
<td>1</td>
<td contenteditable id='textarea'></td>
<td contenteditable id='textarea'></td>
<td contenteditable id='textarea'></td>
</tr>
</table>
Answer Cleared Because of changing the question