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>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $("p").remove(".test");
  });
});
</script>
<style>
.test {
  color: red;
  font-size: 20px;
}
</style>
</head>
<body>

<div>

Toto je nějaký text v div.
<p class="test">Toto je text v odstavci.</p>
<p class="test">Toto je text v dalším odstavci.</p>

</div>
<br>

<button>Odstraní všechny elemetny p s class="test"</button>

</body>
</html>