Advertisement
Creaturion

Untitled

Dec 15th, 2013
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div id="book" align="center">
  2. <script>
  3.   function diffImage(img)
  4.   {
  5.     if(img.src.match(/blank/))
  6.     {
  7.       console.log('black');
  8.       img.src = "../img/book_closed.jpg";
  9.     }
  10.     else
  11.     {
  12.       console.log('blank');
  13.       img.src = "../img/book_opened.jpg";
  14.     }
  15.   }
  16. </script>    
  17. <img src="../img/book_closed.jpg" id="image1" onclick=diffImage(this) />
  18. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement