var name = $("input[#name]").value;
var email = $("input[#email]").value;
var msg = $("input[#msg]").value;
var nameLength = name.length;
var emailLength = email.length;
var msgLength = msg.length;
As you can see, all I'm trying to do is to get the length of the value of the #email field. It works for both of the other fields, but not the email field. It give "TypeError: 'undefined' is not an object".
Any reason why?
I've tried in both Safari and Google Chrome, both gives the same error.
The HTML:
<div class="form-group">
<label class="col-md-4 control-label" for="email">Email</label>
<div class="col-md-5">
<input id="email" name="email" type="text" placeholder="Enter your email address
here" class="form-control input-md" required="">
</div>
</div>