/    Sign up×
Community /Pin to ProfileBookmark

mouse roll over help

Hi I’ve exhausted myself trying to figure out how to use the onmouserollover effect in the place I want it. When my page opens I want a “peace” image to show, and then I click on a button to start my prompts, if I answer “Yes” I want the image of the “smiley” to show on my page in the same place the peace sign was, and when I bring my mouse on the smiley I want the “lightupsmiley” to show. Can anyone help? I cannot seem to put the images in the right spot.
<html>
<head>

<script language=”JavaScript” type=”text/javascript”>
function buttonClick()
{
var myName = prompt(“What is your first name”);

var myPage = prompt(“Do you like my webpage?”);
if (myPage==’Yes’){
document.write(“Thank You”.fontsize(4));
document.write(“<br>”);
document.body.style.backgroundcolor=”red”;
}
else if (myPage==’No’){
document.write (“Fine then”.fontsize(4)+ myName.fontsize(4));
document.bgColor=”orange”;
}
</script>
</head>
<input type=”hidden” id=”hiddenInput” runat=”server” value=””>
<body id=”mybody”>
<img id=”myimage” src=”Peace.gif”
onmouseover=”swapImageOver(smiley.jpg);”
onmouseout=”swapImageOut(lightupsmiley.gif);”>
<p id=”saying”>Welcome?</p>
<br><br>
<button onclick=”buttonClick()”>CLICK</button>
</body>
</html>

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @Tracy01 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...