how to find text in String using JavaScript /JQuery

Example :

<html>
<body>

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

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

</body>
</html>

Output :

Output :
    
     The Rose Is Beautiful Flower

     In the above para we finding 'Beautiful' word's index

     index num: 12