JSFiddle - React, Tailwind, and code Playground
HTML
<br/>Word Count: <input type="text" id="c" name="c" value="311" size="5"
onkeyup="cnt(document.script.w,this)" onchange="showDiv()"/>
</form>
<div id="div1" style="display:none">
Price level 1!
</div>
el 2!
</div>
<div id="div3" style="display:none">
Price level 3!
</div>
<div id="div4" style="display:none">
Price level 4!
</div>
<div id="div5" style="display:none">
Price level 5!
</div>
<div id="div6" style="display:none">
Price level 6!
</div>
<div id="div7" style="display:none">
Price level 7!
</div>
JavaScript
function showDiv() {
var myNumValue = document.getElementById('c').value,
// Get the minimum value between myNumValue / 100 and 6
myNum = Math.min(Math.floor(parseInt(myNumValue, 10) / 100), 6),
// Create an array with 7 entries, and select the element using myNum
myDiv = ["div1", "div2", "div3", "div4", "div5", "div6", "div7"][myNum];
// Show the div
document.getElementById(myDiv).style.display = "block";
}