JSFiddle - React, Tailwind, and code Playground

by Dinker Srivastava

HTML

<p>Click the button to check where if the string includes the specified value.</p>

<button id="btn">Try it</button>

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

<p><strong>Note:</strong> The includes() method is not supported in IE 11 (and earlier versions).</p>

JavaScript

$(document).ready(function() {
  $("#btn").on("click", function() {
   var str = "Hello world, welcome to the universe.";
    var n = str.includes("world");
    document.getElementById("demo").innerHTML = n;
  })
})