Quick Links for all the Tutorials at WebArtz
Here we have a function that have variable x with value 5, and that variable will be displayed. But when? In body tag we have some paragraph with number 4, and there I added an event as you can see. onMouseOver="test()" activate the function when someone pass mouse over paragraph. And thats true. If you test code it will happend for real. When we can use both of them, like onMouseOver and onMouseOut. Well we can with image like this:
But when you look at the code:
Its too much complicated to explain you now because I yet didnt explained nthing about Arrays. So we will just pass this part and will explain you when we learn arrays.
onLoad is used when page loads and its simple:
We have a function and inside it a variable x with value of 4. A function should write that number on screen but it will nto happend if we dont use event. I used event inside body tag (onLoad) and thats why function will work. And last example is on click. We will use it for links (just an example).
Now we have a link on our page, and as soon as someone click on link an event as onClick will activate a function called test. And an alert box will appear. Its all you need to know about events.
|Notice : These tutorials are copyrighted by WebArtz Forum. You may not publish it on anywhere without written permission from the administrators.|