JavaScript Tutorial for Beginners – 35 – Change image with mouseover




In this video we will cover the mouseover event to change images.

Javascript code: http://pastebin.com/PKHFZ5fG
HTML code: http: http://pastebin.com/9sVZDL4p

Original source


11 responses to “JavaScript Tutorial for Beginners – 35 – Change image with mouseover”

  1. one question, in the previous videos you used var text = getElementById but in this one you didn't equate getelemenetbyid to var text. why is that and why was it doen in the previous videos and still worked?

  2. Thank you for the great footage on learning , HTML, CSS, and JAVASCRIPT.
    My computer is Mac.
    I used textWrangler to write my code but having problem for the browser to read it.
    So lately I switched to TextEdit and when I goes over the image, it does change the image but when
    I move the mouse over , the last image is still there. The same happened with the prior lesson , changing the background color!
    Do you know any " text editor" equal to Notepad++ that works for mac ?

  3. hi,
    im folowing your tutorials from html and css, and it was easy until i stuck in javascript. I copy and paste code from this video (i changed name of id and pictures in my doc), but mouse over and mouse off are not working. Dreamweaver find errors in my .js. code. In first line: "newPicture" is defined but never used; secound line: Missing "use strict" statemant; in third line: "oldPicture" is defined but never used; line four is missing strict like line two. So, functions are defined but never used, and document.getElementsById miss some "strict" comand. Can you help me to solve problem?

Leave a Reply