How to find a text in a string using the search() method in javascript/jquery

Example :

<html>
<body>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

<p id="para">Rose Is Beautiful Flower</p>
<p>In the above para we finding 'Flower' word's index </p>
<p id="output"></p>
   
  <script type="text/javascript">
   
    $(document).ready(function(){
	var str = $('#para').text();
	$('#output').text('index num: '+str.search('Flower'));
     });
	  
</script>

</body>
</html>

                                 

Output :

Output :
     Rose Is Beautiful Flower
     In the above para we finding 'Flower' word's index
     index num: 18