How does javascript change the link address of the picture?
This article mainly explains the "javascript how to change the picture link address", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "javascript how to change the picture link address" bar!
The method for javascript to change the link address of a picture: [_ window.onload = function () {ImageSrc ();} function ImageSrc () {var imgs = document.getEleme...].
This article operating environment: windows10 system, javascript 1.8.5, thinkpad T480 computer.
How to change the link address of a picture by JavaScript:
_ window.onload = function () {ImageSrc ();} function ImageSrc () {var imgs = document.getElementsByClassName ("ArticleBody") [0] .getElementsByTagName ("img"); for (var I = 0, l = imgs.length; I
< l; i++) { imgs[i].src = imgs[i].src.replace("gjbt", "www"); //img[i].src is the reference to the image. } }
Thank you for your reading, the above is the content of "javascript how to change the picture link address", after the study of this article, I believe you have a deeper understanding of how to change the picture link address of javascript, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!