This is going to depend on what limits there are on the numbers, but the basic pure HTML/CSS technique is to use a duplicate of the attribute that is type='hidden' : <input type='number' name='attr_level' value='0'>
<input type='hidden' class='display-control' name='attr_level' value='0'>
<div class='spell level-1'></div>
<div class='spell level-2'></div>
<div class='spell level-3'></div>
<div class='spell level-4'></div>
<div class='spell level-5'></div> .spell{
display: none;
width: 100px;
height: 50px;
background-color: black;
margin-bottom: 5px;
}
.display-control[value='1'] ~ .spell.level-1,
.display-control[value='2'] ~ .spell.level-1,
.display-control[value='2'] ~ .spell.level-2,
.display-control[value='3'] ~ .spell.level-1,
.display-control[value='3'] ~ .spell.level-2,
.display-control[value='3'] ~ .spell.level-3,
.display-control[value='4'] ~ .spell.level-1,
.display-control[value='4'] ~ .spell.level-2,
.display-control[value='4'] ~ .spell.level-3,
.display-control[value='4'] ~ .spell.level-4,
.display-control[value='5'] ~ .spell.level-1,
.display-control[value='5'] ~ .spell.level-2,
.display-control[value='5'] ~ .spell.level-3,
.display-control[value='5'] ~ .spell.level-4,
.display-control[value='5'] ~ .spell.level-5{
display: block;
} Now, that's obviously a lot of CSS, and gets unreasonable very quickly. A better choice is probably to make your spells a repeating section and use a sheetworker to create/delete rows as needed based on the value of the controlling attribute.