easy syntax question....

M

Michael

Hi,

why is it ok to have:

function home_mouseover(){
document.getElementById("hom").src = home_night.src;
}

<a href="./home.shtml" onmouseover="home_mouseover();">

but not ok (results in a syntax error) to have:

<a href="./home.shtml" onmouseover="document.getElementById("hom").src =
home_night.src;">

aren't these the same?

Thanks for your help.

Michael
 
J

John W. Kennedy

Michael said:
Hi,

why is it ok to have:

function home_mouseover(){
document.getElementById("hom").src = home_night.src;
}

<a href="./home.shtml" onmouseover="home_mouseover();">

but not ok (results in a syntax error) to have:

<a href="./home.shtml" onmouseover="document.getElementById("hom").src =
home_night.src;">

aren't these the same?

Both HTML and JavaScript use " to quote. You have to straighten that out.
 
M

Michael

John W. Kennedy said:
Both HTML and JavaScript use " to quote. You have to straighten that out.


--
John W. Kennedy
"The blind rulers of Logres
Nourished the land on a fallacy of rational virtue."
-- Charles Williams. "Taliessin through Logres: Prelude"

Thanks for that :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top