Oups désolé.
J'avais mis
<!DOCTYPE html>
<html>
<body>
<p>Click the button to display the value of the value attribute of the hidden input field.</p>
<span name='moins2' title='Valider' class='btn_achat_fiche btn_modifier_niveau_hench' onclick='moins2niveaux(0)'>-2</span>
<input type='hidden' name='nombredeniveaux0' value='' />
<script>
function moins2niveaux(i)
{
document.getElementById("nombredeniveaux0").value = "-1";
alert(document.getElementById("nombredeniveaux0").value);
}
</script>
</body>
</html>
Effectivement c'est lié au fait que j'ai mis un name et non un id et pourtant c'est marqué dans le code javascript ...
Merci pour l'aide