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>