jQuery
How To Convert Text String To Upper Case Using jQuery
As can be seen from my previous article, string maipulation can be really helpful when using jQuery. That said, do you know how to convert an existing string of text to uppercase i.e. make all characters upper case. In this article, I am going to share easy examples with demos that show you how to do so. Read on for more.
Make String Upper Case using jQuery
Let’s assume that we have a random string with different variations of text, i.e Upper case, Lower case and both.
Example: Converting all text of a string to upper case
<script type="text/javascript"> $(document).ready(function() { var str_original = 'This IS SOme randOM STRING.'; alert( str_original ); var converted_text = str_original.toUpperCase(); alert( converted_text ); }); </script>
Simple, isn’t it?
Do you know of any other ways to perform string conversion to uppercase using jQuery? Feel free to suggest by commenting below.