JSFiddle - React, Tailwind, and code Playground

HTML

<!DOCTYPE html>
<html>

  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>Value in a span using JQuery.</title>
  </head>

  <body>
    <p>jQuery<span class="alias" style="color:red">Exercises</span>.</p>
    <p>jQuery<span class="alias" style="color:
red">Exercises</span>.</p>
    <input id="button1" type="button" value="Click to see the changes" />
  </body>

</html>

JavaScript

$(document).ready(function(){ 
  $('#button1').click(function(){ 
   alert($(".alias").text());
   });
});