My professor has a unique task that prevents us from using any JQuery or basically anything that isn't Javascript or HTML/CSS.
I have to, on a mouse click, update the value within a cell with some numeric value. I am new to Javascript and basically here is what I am working with.
<table id="score">
<tr>
<td> One's </td>
<td class="scoring" id="ones" onClick="inputScore()"> </td>
</tr>
</table>
What I want to do is click the cell with id=ones and insert a value of 50 with the function inputScore(). What is the best way to approach this using only Javascript? Thanks in advance.
Edit: Code ported from comments:
<script>
function inputScore() {
var x = 50;
document.getElementById("ones") = x;
}
</script>
<script> function inputScore() { var x = 50; document.getElementById("ones") = x; } </script>This is more or less what I am trying to do, he didn't go into great detail on how to do this and I cannot find anything concrete online about this type of issue.