mardi 19 juillet 2016

JQuery can't get input value on element

All I'm trying to do is get the val() of an Text Input. Here is an example.

I don't know if external links are allowed so I will also paste it here :

<div class="input-group">
  <input type="text" id="#test" class="form-control" aria-label="..." style='border-radius:4px;'>
</div>

<script>
  // Always shows up as undefined..not "".
  console.log($("#test").val());
</script>

Does anyone know why I cannot get the value of this element?

Aucun commentaire:

Enregistrer un commentaire