<html>
<body>
<p>Click the button to extract parts of the string.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var str = "Hello world!";
var res = str.substr(1, 4);
document.getElementById("demo").innerHTML = res;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_substr by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 14:03:08 GMT -->
</html>