I am learning how to use javascripts and I am starting real slow, but this script won't work.
"mainpage" and "logo" are defined styles, and the I have this for a doctype:
I've tried other doctypes and they don't work either. If I took the alert out of the onclick, then it works. Does anybody have any idea what really simple and silly mistake I am making
Code:
<body bgcolor="#000000"> <div id="mainpage"> <div id="logo"></div> <a href="#" onclick="alert("This is a test");">This is test</a> </div> </body> </html>
Code:
<!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">
Comment