Settting value of a variable in a function

I’m trying to set a value of a variable to an image but I am receiving the error scale is not defined. I am getting the error when i try to set val.

var getimage=document.getElementsByClassName("img");
var getrange=document.getElementById("control")
function resizeimage(val){

    for(var i=0;i<getimage.length;i++){

        var chek1 = document.getElementById("check-img1");
        var chek2 = document.getElementById("check-img2");

With the code you posted, I do not see a function named scale, but you attempt to call a function named scale in the following line:


Perhaps you meant to type:

getimage[0].style.tranform="scale(" + val + ")";