- Client-side validation: by using this application much more responsive and no need for the round trip on server.ex. Form-Validation by using client-side validation we reduce the round trips on a server which means we reduce the load on the server.
The script tag should be placed in body or head section of Html page and in general <script> tag can be placed in the body of Html.
If you placed <script> tag in head section of Html page then if your controls not loaded till now then your code might not work.
It is better to place the <script> tag near closing body tag.
console.log('Hello Sagar Jaybhay'); //output Hello Sagar Jaybhay
It id different from this below code
console.Log('Hello Sagar Jaybhay');
The output of this code is
TypeError: console.Log is not a function
var a="10"; var b="20"; c=parseInt(a)+parseInt(b); console.log(c)
By using this method you not lose decimal places so whenever needed use this parsefloat
var a="10.2"; var b="20.3"; c=parseFloat(a)+parseFloat(b); console.log(c)
var a="sagar" console.log(isNaN(a)) //true var b=10 console.log(isNaN(b)) //false