Showing posts with label Convert string to lowercase using JQuery. Show all posts
Showing posts with label Convert string to lowercase using JQuery. Show all posts

Monday 29 August 2016

Convert string to lowercase using JQuery

In this post, I will explain how to convert String to lower case letters using JQuery.

Many times there is a requirement of converting a string to lower case string in web programming. We can do this using JQuery toLowerCase method. JQuery toLowerCase method returns a lowercase string. It will not modify a current variable.

var name = 'JQuery With Example';
alert(name.toLowerCase());

<!DOCTYPE html>
<html  lang="">
<head>
  <title>jQuery With Example</title>
  <script src="http://code.jquery.com/jquery-1.9.1.js" type="text/javascript"></script>
  <script type="text/javascript">
    $(function () {
      $('.btnClick').click(function () {
        var name = 'jQuery With Example';
        alert(name.toLowerCase());
      });
    });
  </script>
</head>
<body>
  <div>
    <button class="btnClick">Click</button>
  </div>
</body>
</html>