It is very much possible to create webpages that are "dynamic", that its, they change what they do or how they look in response to something that happens. The thing that happens is called an "event handler"; here are some examples of this:
onload -- when the webpage loads into the browser
onunload -- when the browser leaves the webpage
onmouseover -- when the mouse arrow goes over something
onmouseout -- when the mouse arrow is no longer over something
onmousedown -- when the mouse button is pressed
onmouseup -- when the mouse button is released
onclick -- when the mouse button is pressed then released
After the event handler takes place, there has to be some kind of action in response to it. The simplest kind of response is called an "alert" -- its a simple dialog box that pops up which has a message on it
So let's try doing something like this:
Please understand, this is not a new paragraph container you are making; just use one of the ones you already have. Just don't get this new code mangled up with code you already have. AND, be very careful to put in the proper type of quotes...it absolutely matter whether you type in a ' versus a "
If you get that to work, let's try some other types of events, each time using an alert as being the response to that event. For example, try this:
This will make an alert message pop up when this webpage is loaded into the browser.
Try at least four other types of alerts. See what you can get to happen. Please be SCHOOL APPROPRIATE
cheers,
Mr. L
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.