Upper Case input element value using jQuery

You can convert an input element value into upper case (all letters in capital letters) with the help of toUpperCase function. The example of toUpperCase method mentioned below: Code


<html>

  <body>
     <input type='text' value='Good Morning' id='inputElem'>>  
    <script language='JavaScript' type='text/Javascript'>
      var result = $('#inputElem').val().toUpperCase();
    </script>
  </body>
</html>
Output

'result' variable's value would be 'GOOD MONING'