Programmatically change the src of an img tag

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

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


         


        
9条回答
  •  清歌不尽
    2020-11-22 05:32

    Maybe because you have a tag like a parent of the tag. That why you have to click two time the images.

    For me the solution is this: http://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_lightbulb

提交回复
热议问题