Reputation: 13
I'm trying to resize a div
when the size of the div is 50% to 100%. But when I try to console.log
the current size of the div
it just logs whitespace... Whats wrong?
window.onload = function() {
//declare vars
var fullbox = document.getElementById('box'),
minBut = document.getElementById('down');
minBut.onclick = function() {
if(fullbox.style.width == "50%") {
fullbox.style.width = "100%";
} else {
fullbox.style.width = "50%";
}
}
}
Upvotes: 0
Views: 291