Html page:
<button onclick="myFunction()">Try it</button>
Javascript page:
<script>
function myFunction() {
var str = " Hello World! ";
alert(str.trim());
}
</script>
Output:
Hello World!
No comments:
Post a Comment