document.getElementByClassName("preview").innerHTML=src;
function update(previewPic){
/* In this function I should
1) change the URL for the background image of the div with the id = "image"
to the source file of the preview image
2) Change the text of the div with the id = "image"
to the alt text of the preview image
*/
document.getElementById("image").setAttribute('style', 'background-image: url(' + previewPic.getAttribute("src") + ')');
document.getElementById("image").innerHTML = previewPic.getAttribute("alt");
}
function undo(){
document.getElementById("image").style.backgroundImage = "";
document.getElementById("image").title = "";
}
Also in HTML:
- modal lightning salesforce
- how to substract date object javascript
- vmware 12 linux
- mark tag in html
- how to add javascript to html
- html input placeholder
- my html file shows code in browser
- how To fetch the index of dropdown in html
- table html structure
- marquee
- howto include the single quotes in html
- excel vba largest value
- html link tag
- making a website loader js
- how to put an image in html
- set default value of a multiselect in html
- html to json
- how to make a textbox in html
- electron reload html
- ionic button
- decode HTML Entities react
- what is html
- html w3school
- html hyperlink with question mark in a form action