hello ive been trying to insert a java code to change the images of my buttons when the mouse is held over i have followed these codes

<script type="text/javascript">
function mouseOver()
document.b1.src ="t5fshop.png"
function mouseOut()
document.b1.src ="t5fshop2.png"
<td width="191"><a href="http://www.bob.com" 
<img border="0" img src="t5fshop.png" name="b1" width="190" height="50" /></a></td>

in dreamweaver when i click to see what it looks like in a ie6 browser nothing happens to the button when i hold it over? im wondering wether this is because i havent sent the images to a server yet? thanks for your help in advance

Recommended Answers

All 6 Replies

Please use the "shift" and apostrophe keys on your keyboard, where appropriate. We don't like "sloppy" posts here.

What doctype are you using in your pages? The proper way to reference HTML elements is to give each element a unique "id".

Then, to return a reference to the element (so you can change the "src", for example) you use document.getElementById('myID') .

So start by giving your href element an ID, and changing your script to use the "getElementById" method.

commented: dont like people talking down to me +0

well i copied this off the w3school web standards so i thought it was proper way to reference code. where would i insert the id code? i am a begginer at all of this so im sorry if i come across as an amatuer. i wouldnt ask for help otherwise.

the doctype i am using is
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">"

You add the id just like have the "name" attribute now. Your image tag is also messed up. It's got an extra "img" inside of it.

In English, the pronoun to refer oneself is "I", not "i".

haha in communication as long as somone gets the message it doesnt matter what language you use. thanks for the tips

I strongly disagree, and in fact so does Daniweb's official rules. Communication is about conveying "the message" as clearly as possible. Here, that means writing your posts in conventional, standard English.

Glad I could help.

commented: what is capitalization? LOL +3


In spirit, I tend to agree with you...however, each setting has its own set of policies and procedures.

As this forum is intended as a professional outlet, proper use of pronouns and sentence structure are not just appreciated...they are expected.

As a student, you would be wise to learn that in the real world the ability to present yourself in a professional manner is just as important as the ability to communicate your thoughts.

Please follow the proper etiquette when making further posts to our forum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.