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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Class change color </title>
<!--JScript checking and changing front colors.-->
<script type="text/javascript">
function coulorer(continent){
var itemsid = document.getElementById("items");
for (i=0;i<7;i++){
itemsid.getElementsByTagName('li')[i].style.color='#eee';
}
var itemsct = document.getElementsByName(continent);
for (i=0;i<7;i++){
itemsct[i].style.color='#11ADE4';
}
}
</script>
<link rel="stylesheet" type="text/css" href="media/mystyle.css">
</head>
<body>
<h4> Continent of the world </h4>
<ul class="menu">
<li onclick="coulorer('africa')"> Africa </li>
<li onclick="coulorer('asia')"> Asia </li>
<li onclick="coulorer('europe')"> Europe </li>
</ul>
<br />
<ul type="circle" id="items">
<li name="africa"> Morocco </li>
<li name="africa"> Egypt </li>
<li name="africa"> South africa </li>
<li name="asia"> UAE </li>
<li name="asia"> Japan </li>
<li name="europe"> Italy </li>
<li name="europe"> UK </li>
</ul>
</body>
</html> |
Partager