javascript change image src
//change image src
document.getElementById('myImageID').src="images/my_other_image.png";
javascript change image src
//change image src
document.getElementById('myImageID').src="images/my_other_image.png";
set img src using javascript
document.getElementById("imageid").src="../template/save.png";
js get image src
var youtubeimgsrc = document.getElementById("youtubeimg").src;
js load img
var elements = [];
function loaded(){
console.log("you have loaded an image");
}
CreateFileFrom("your/dir/here/img.png");
function CreateFileFrom(dir){
/* defining runtime variables */
var extension = dir.split('.').pop();
var keys = {"png":"IMG","jpg":"IMG","jpeg":"IMG",
"js":"SCRIPT","json":"SCRIPT",
"mp3":"AUDIO","wav":"AUDIO"};
var obj = document.createElement(keys[extension]) || {};
obj.src = dir;
/* onload function called when the resource is loaded */
obj.onload = (e) => {
elements.push(e.path[0]);
loaded()
}
/* make sure that the data is compitable */
if(keys[extension]==null){console.error("not supported media type "+extension);return;}
}
how to edit image tags in javascript
<a href='#' onclick='edit()'><img src="../template/edit.png" id="edit-save"/></a>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us