Quick Buck For Js Programmer

You need to write two quick JS functions.

jQuery is not an option. You can not use getElementById or getElementsbyTagName. You can use only the following DOM objects:

childNodes
lastChild
firstChild
src
style

The Task:

I have a HTML table and want two actions to happen, when you hover over a <td>.
The img with the class “changevisibility” is set to “display:none;”, when you hover over the <td> then the style of this image is supposed to be set to “display:inline”.
The second thing that needs to be changed on hover is the src attribute of the image with the class “changebutton”.
Please change that to “button2.png”

Two functions, beceause the default values have to be restored once the mouse moves out again.

I have attached the HTML code with the event handlers and the designated function names.

Leave a Reply

Your email address will not be published. Required fields are marked *