Skip to content

Instantly share code, notes, and snippets.

@gregbarcza
Last active August 29, 2015 13:55
Show Gist options
  • Save gregbarcza/8706626 to your computer and use it in GitHub Desktop.
Save gregbarcza/8706626 to your computer and use it in GitHub Desktop.
<style>
div{
background:black;
display:inline-block;
min-height:10px;
}
</style>
<form onsubmit="return abrazol()">
<input name='szam1' id="szam1" type='text' value=''> <div id='d1'> </div><br/>
<input name='szam2' id="szam2" type='text' value=''> <div id='d2'> </div><br/>
<input name='szam3' id="szam3" type='text' value=''> <div id='d3'> </div><br/>
<input name='szam4' id="szam4" type='text' value=''> <div id='d4'> </div><br/>
<input name='szam5' id="szam5" type='text' value=''> <div id='d5'> </div><br/>
<input name='belep' type='submit' value='Abrazol'>
</form>
<script>
function abrazol(event){
document.getElementById('d1').style.width=document.getElementById('szam1').value;
document.getElementById('d2').style.width=document.getElementById('szam2').value;
document.getElementById('d3').style.width=document.getElementById('szam3').value;
document.getElementById('d4').style.width=document.getElementById('szam4').value;
document.getElementById('d5').style.width=document.getElementById('szam5').value;
return false;
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment