I'm trying to make a function that whenever I click on the button, the image on the screen width decrease by 100px, the width of the picture are all 800px here is what I have:
var width_of_pic = 800 ;
function shrink() {
width_of_pic = width_of_pic - 100;
var image_element= document.getElementById( "image_element_id" ) ;
image_element.style.width = width_of_pic;
}
... = width_of_pic + 'px';. no units = invalid assignment.