storkfmny — 2014-05-21T12:04:06-04:00 — #1
Is it possible to use a HTML5 number input box as a variable to change the width of a div?
How would this be done if possible.
I need to be able to adjust the width to less or more.
storkfmny — 2014-05-22T23:58:36-04:00 — #2
Solved it myself. I know it's simple but the syntax always kills me.
check it out here... whatarethelotterynumbers.org
I get frustrated but like it when I figure this stuff out on my own.
john_betong — 2014-05-23T00:29:33-04:00 — #3
For the benefit of others please explain how you managed to solve the problem.
storkfmny — 2014-05-23T01:51:12-04:00 — #4
I was just thinking, better go back and show my code for anyone else looking to do something similar.
w = document.getElementById('control').value;
document.getElementById('content').style.width = (w + '%');
"Control" represents the HTML5 numberbox.
"Content" is the div to be manipulated.
"w" is the variable and also represents the innerHTML.value of the numberbox.
Works really well.
Thanks for this site, I have learned much here.
Not bragging, I'm far from being a coder but I love the fact that I made my own sites (with help at first) but do about everything I need now.