Prev Demo
JavaScript
>
Trim() Method
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>Removing white space</h1> <p>Click the below button to remove the white space.</p> <input type="button" value="Trim" onclick="Function()" /> <script> function Function() { var A = " TechFunda & DotNetFunda "; alert(A.trim()); } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output