Programmatically change the src of an img tag

后端 未结 9 1646
执念已碎
执念已碎 2020-11-22 04:31

How can I change the src attribute of an img tag using javascript?


         


        
9条回答
  •  孤街浪徒
    2020-11-22 05:25

    its ok now

    function edit()
    {   
        var inputs = document.myform;
        for(var i = 0; i < inputs.length; i++) {
            inputs[i].disabled = false;
        }
    
        var edit_save = document.getElementById("edit-save");
    
           edit_save.src = "../template/save.png";                              
    }
    

提交回复
热议问题