a learning noobie here.
I am needing a script that can take a number value and assign a letter to it, depending on the range the value falls within. Please run the simple example below:
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
<table>
<tr>
<th>Achieved mark</th>
<th>Grade</th>
</tr>
<tr>
<td>Above 80 (max 100)</td>
<td>A</td>
</tr>
<tr>
<td>60-79</td>
<td>B</td>
</tr>
<tr>
<td>40-59</td>
<td>C</td>
</tr>
<tr>
<td>Below 39 (min 0)</td>
<td>D</td>
</tr>
</table>
<br>
<p>Enter achieved mark:</p>
<input type="input" id="mark" value="73">
<button onclick="myFunction()">GO!</button>
<p>Grade result:</p>
<input type="output" id="grade">
For this above example, when the "GO!" button is clicked, a grade letter would be output depending on the range of the input value.
Thank you in advance.