Forcer le focus d'un champ au chargement d'une page
Bonjour je cherche a savoir pourquoi mon code javascript qui devrait me premettre de forcer le focus d'un champs d'une page ne marche pas...
Code:
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
| <html>
<head>
<title></title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="" name="keywords">
<meta content="" name="author">
<meta content="" name="description">
<link href="css/resetnav.css" type="text/css" rel="stylesheet">
<link href="css/index.css" type="text/css" rel="stylesheet">
<script src="javascript/date_heure.js" type="text/javascript">
<script type="text/javascript">
function FocusOnInput()
{
document.getElementById("mdp").focus();
}
</script>
</head>
<body onload="FocusOnInput()">
<div id="taille">
<div id="pagebadge">
<p></p>
<br>
<form action="badge.php" method="post">
<input id="mdp" type="password" autocomplete="off" name="mdp">
<br>
<br>
<input type="checkbox" value="mission" name="mission">
Mission
<br>
<br>
<span id="date_heure">13:26</span>
<script type="text/javascript">
window.onload = date_heure('date_heure');
</script>
<br>
<br>
<input class="submit" type="submit" value="Badger" name="submit">
</form>
</div>
</div>
</body>
</html> |