Javascript examples for String:slice
Extract the whole string:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w ww.j a va 2 s. c o m*/ var str = "Hello world!"; var res = str.slice(0); document.getElementById("demo").innerHTML = res; } </script> </body> </html>