display a particular word as bold in a String got from Web Service response? - Javascript jQuery

Javascript examples for jQuery:String

Description

display a particular word as bold in a String got from Web Service response?

Demo Code

ResultView the demo in separate window


<html>
   <head> 
      <script src="https://code.jquery.com/jquery-2.0.3.min.js"></script> 
   </head> 
   <body> 
      <script>
var str = "Your String here";
$('body').append(str.replace('here', '<b>here</b>'));

      </script>  
   </body>/*from  ww  w.  ja va2  s  .co  m*/
</html>

Related Tutorials