Help with $ (this) .val () toUpperCase ()
Given:
<script type="text/javascript"> $(document).ready(function () { var str = 'Test'; //alert(str.toUpperCase()); $('#stringFinder').keyup(function (e) { alert($(this).val()==str.toUpperCase()); }); }); </script> How do I make $ (this) .val () all uppercase to get a similar comparison using?
Thanks rodchar
+4
3 answers
$(this).val() returns a String object , which means that you are executing String methods , like this:
alert($(this).val().toUpperCase() === str.toUpperCase());
+13