JSFiddle - React, Tailwind, and code Playground

by Sagar Agrawal

HTML

<!DOCTYPE html>
<html>
<body>

<p>Click the button to display the array values after the split.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
  var str = "How are you!! doing !today?";
  var x = ["!", "?"];
  var res = str.split(x[0]);
  var res2 = str.split(x[1]);
  document.getElementById("demo").innerHTML = (res.length-1 >=2 || res2.length-1 >=2);
}
</script>

</body>
</html>