HTML CSS Background-Image Help!!!

Ran it on JSFiddle: Edit fiddle - JSFiddle

Had to tweak it a bit...but Chrome's Console in Dev Mode show's the JS onmouseover event is firing. I set it to just show an alert() box as well through JS and the alert box popped up just fine.
 
Trying something different:
Code:
<html>
	<head>
		<title> Countdowns | Welcome! </title>
		
		<link <link rel="stylesheet" type="text/css" href="indexstyle.css">
		
	</head>

	<body class="bg">

		<div class="spacer2"></div>

		<div class="spacer">
			
			<p class="introduction">
				
				<b> Welcome to Countdowns </b> 
				
				<br> 

				<i class="motto"> Wait in Anticipation of the Future </i> </p>
		</div>

		<div class="body">
			
			<a href="#" onmouseover="document.getElementById('gotosite').

			src='b.png';"

			onmouseout="document.getElementById('myimage1'src='bmo.png';">   

			<img src="b.png" id="gotosite" /></a>
		
		</div>	
	
	</body>

</html>

Still doesn't work, what am I doing wrong???
 
You have no closing parentheses on your onmouseout property.

There's also no control with an ID of 'myimage1' that you're trying to find in your onmouseout either, so that won't do anything.

You can test things using console.log('texthere') as well, like I'm doing here:
Edit fiddle - JSFiddle

Just open up your Dev tools in browser, go to the Console section and watch the logs. I'd go back to your function and add console.log message outputs so you can "trace" what's firing and what's not firing.
 
Still doesn't work, what am I doing wrong???

You're mixing up syntax and logic errors. They're two very different things. Console isn't used for syntax.

Debugging is what the Console object should be used for. Use it to see various stages of what your program is doing and compare that what you expect it to do.
 
Last edited:
Back
Top Bottom