<html>
<body>
<h1>JavaScript String Methods</h1>
<h2>The sub() Method</h2>
<p id="demo1"></p>
<p>The sub() method is deprecated in JavaScript.</p>
<p>Use the sub tag instead:</p>
<p id="demo2"></p>
<script>
let text = "Hello World!";
let result = text.sub();
document.getElementById("demo1").innerHTML = text + " " + result;
result = "<sub>Hello World!</sub>"
document.getElementById("demo2").innerHTML = text + " " + result;
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_str_sub by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 18:16:43 GMT -->
</html>