-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
  • 17,375
  • 25
  • 118
  • 194

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
  • 36,319
  • 9
  • 49
  • 62