Edit This Code:
See Result »
<!DOCTYPE html> <html> <body> <p>The substr() method extract a part of a string and returns the extracted parts in a new string:</p> <p id="demo"></p> <script> var str = "Apple, Banana, Kiwi"; document.getElementById("demo").innerHTML = str.substring(7, 13); </script> </body> </html>
Result: