Search
 
SCRIPT & CODE EXAMPLE
 

HTML

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 = "";
}
Comment

PREVIOUS NEXT
Code Example
Html :: compile haml to html 
Html :: phanuel mutuma 
Html :: html link without opening new tab 
Html :: html encrypt email from bots 
Html :: angular variable in html 
Html :: html script source 
Html :: pug html adalah 
Html :: Creating WebLinks in a ReadME 
Html :: react router preventing assets from being served 
Html :: display c# code in html 
Html :: twig check if variables iterable 
Html :: salesforce required asterisk input filed 
Html :: code html view mobile inspect link head metalink 
Html :: html fecha mes y año 
Html :: html body farbe ändern 
Html :: hirudhi map 
Html :: what is an NFT? 
Html :: how to inlcudes js in html 
Html :: put picture in iphone frame html 
Html :: Header in PDF page using DOMPDF in PHP 
Html :: eml vs emlx files 
Html :: accident news report 
Html :: how to add checkbox in table html 
Html :: collapsableTableColumns 
Html :: icon not shwing in goole search 
Html :: wp bakery add shortcode backend 
Html :: markdown open link in new tab 
Html :: display letter in html element letter by letter 
Html :: <iframe src="//content.jwplatform.com/players/V2BtPQRy-eMYSo360.html" width="480" height="270" frameborder="0" scrolling="auto"</iframe 
Html :: html5 tutorial 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =