-3

here is my jquery

 var obj=$("#Connect");
  alert($("#Connect").value);

The value appeared to be undefined, but I have a html tag there

<input type="button" id="Connect" value="Connect"/>

what is the problem?

william007
  • 15,661
  • 20
  • 90
  • 161

1 Answers1

3

you are mixing jquery and javascript here...correct way to get value in jquery is val()

try this

jquery

alert($("#Connect").val());

javascript

 alert(document.getElementById("Connect").value);
bipen
  • 35,563
  • 9
  • 45
  • 62