Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67527

use element by its id using $ [duplicate]

$
0
0

This question already has an answer here:

I am a beginner, and I`m trying to understand why the $("#ErrorLabel") doesn't work, while document.getElementById does work. It's happening to me a lot and it freaks me out.

<script language="javascript">

   function SendLoginData()
   {
       $("#ErrorLabel").style.display = "block";
       //work ---> document.getElementById("ErrorLabel").style.display = "block";
   }

</script>

     <input id="submit" type="button" value="Login" class="btn btn-primary" onclick="SendLoginData()" />
     <label id="ErrorLabel" style="color:red;display:none">*Wrong login detail !</label>   

Viewing all articles
Browse latest Browse all 67527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>