Hello Im wondering how to do a selection in the input and get the number of squares that the input selected, so if I select the number three get only three squares displaying.
codehttps://codepen.io/josemon322/pen/oNvZeqb
HTML
<p>show me <form>
<select id="mySelect">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="4">5</option>
<option value="4">6</option>
</select>
</form> squares</p>
<div id="square"></div>
CSS
p {
display: inline-block;
margin: 0;
}
#square {
height: 50px;
width: 50px;
background-color: #555;
margin: 5px;
}
form {
display: inline-block;
}
JS
var myDiv = document.getElementById('square');
for(var i=0; i < 6; i++) {
document.body.appendChild(myDiv.cloneNode(true));
}