forked from bashaappiness/JS-training
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevents.html
26 lines (25 loc) · 781 Bytes
/
events.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>JS - Events</title>
<meta charset="windows-1252">
<meta name="viewport" content="width=device-width">
</head>
<body onload='alertFun()'>
<p onmouseover='changecolor()' id='text'>Some text</p>
<script type="text/javascript">
function changecolor(){
var txt = document.getElementById('text');
txt.style.color = "red";
}
function alertFun(){
alert('page loaded');
}
</script>
</body>
</html>