Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript alternance images

function swap(X)
     {
     if ( X.src == "images/icone/RECORD_1.svg" )
          X.src = "images/icone/RECORD_0.svg" ;
     else
          X.src = "images/icone/RECORD_1.svg" ;
     }
  
<img src="images/icone/RECORD_1.svg" onclick="swap(this)">
Source by openclassrooms.com #
 
PREVIOUS NEXT
Tagged: #javascript #alternance #images
ADD COMMENT
Topic
Name
3+4 =