Javascript examples for Boolean:toString
The toString() method returns a boolean value as a string.
This method is called whenever a boolean is used in a string operation.
None.
A String, either "true" or "false"
The following code shows how to Convert a Boolean value to a string:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from ww w .j av a 2 s . c om*/ var bool = true; var x = bool.toString() document.getElementById("demo").innerHTML = x; } </script> </body> </html>