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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Essai</title>
<style type="text/css" media="screen">
.visible{
background-color:#ccc;border:1px #ccc solid;visibility:visible
}
.hidden {
background:none;border:none;visibility:hidden
}
</style>
</head>
<body>
<span id="id1">Texte</span>
<div id="id2" class="visible">
Phrase dynamique
</div>
<script type="text/javascript">
var elt=document.getElementById('id1');
elt.onmouseover=function(){document.getElementById('id2').className='hidden';}
elt.onmouseout=function(){document.getElementById('id2').className='visible';}
</script>
</body>
</html> |