I would like to display the value of the input #nom as a string in the label tag
<input type="text" id="nom">
<input type="button" id="ok" value="afficher" onclick="affiche();">
<label id="msg"></label>
I have tried the following script, but it does not work and returns no errors.
function affiche() {
var nom = document.getElementById("nom").value;
$("#msg").val(nom);
}
What am I doing wrong?