<html>
<body>
<h2>JavaScript String.trim()</h2>
<p>Click the button to alert the string with removed whitespace.</p>
<button onclick="myFunction()">Try it</button>
<p><strong>Note:</strong> The trim() method is not supported in Internet Explorer 8 and earlier versions.</p>
<script>
function myFunction() {
var str = " Hello World! ";
alert(str.trim());
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_string_trim by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:39:29 GMT -->
</html>