Javascript examples for String:toString
The toString() method returns the value of a String object.
None.
A String, representing the value of a string
The following code shows how to Return the value of a String object:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w w w .ja v a 2 s . co m*/ var str = "Hello World!"; var res = str.toString(); document.getElementById("demo").innerHTML = res; } </script> </body> </html>