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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
var bonjourOUbonsoir=0 ;
function ecrireBonjour()
{
if(document.getElementById('un').style.visibility == 'hidden')
document.getElementById('un').style.visibility = 'visible';
else
document.getElementById('un').style.visibility = 'hidden';
}
function ecrireBonsoir()
{
if(document.getElementById('deux').style.visibility == 'hidden')
document.getElementById('deux').style.visibility = 'visible';
else
document.getElementById('deux').style.visibility = 'hidden';
}
function bonjour()
{
setInterval('ecrireBonjour()',1000);
}
function bonsoir()
{
setInterval('ecrireBonsoir()',1000);
}
function test()
{
alert(bonjourOUbonsoir);
if(bonjourOUbonsoir)
{
bonjourOUbonsoir=0;
bonjour();
}
else
{
bonjourOUbonsoir=1;
bonsoir();
}
}
</script>
</head>
<body>
<div id="left" style="left: 400px; top: 9px; width: 350px; height: 350px">
<p id="un" style="visibility:hidden">
Bonjour
</p>
<p id="deux" style="visibility:hidden">
Au revoir
</p>
</div>
<br/>
<input type=button value="Changer"
onclick= test() >
</body>
</html> |