Wednesday, June 2, 2021

Slip 10. Write a jQuery code to make first word of each statement to bold.

 

Slip 10. Write a jQuery code to make first word of each statement to bold. 

<!DOCTYPE html>
<html>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  
  <body>
    <p>Computer Application</p>
    <p>Autocad</p>
    <p>Data Structure using c</p>
    <p>Software Testing</p>
    <p>Java Programming</p>
  <script>
     $(document).ready(function(){
       $('p').each(function(){  
          var pdata = $(this);  
          pdata.html(pdata.text().replace(/(^\w+)/,'<strong>$1</strong>'));  
        }); 
     });
   </script>
  </body>
 </html>






Slip 10. Write a jQuery code to make first word of each statement to bold.

  Slip 10. Write a jQuery code to make first word of each statement to bold.  <!DOCTYPE html> <html>   <head>     <scri...