Highlight lowercase letters with Regex - Javascript String Operation

Javascript examples for String Operation:String Case

Description

Highlight lowercase letters with Regex

Demo Code

ResultView the demo in separate window

<html>
   <head></head>
   <body> 
      <p> This is an exaMPLe. this is a Test </p> 
      <script>
var p = document.querySelector("p");
var html = p.innerHTML;
html = html.replace(/([a-z]+)/g, "<strong>$1</strong>");
p.innerHTML = html;

      </script>  
   </body>/*  ww  w.  j  a  v a  2  s . co m*/
</html>

Related Tutorials