JS CheatSheet Basics ➤ On page script < script type = "text/javascript" > ... </ script > Include external JS file < script src = "filename.js" ></ script > Delay - 1 second timeout setTimeout ( function () { } , 1000 ) ; Functions function addNumbers (a, b) { return a + b; ; } x = addNumbers( 1 , 2 ); Edit DOM element document . getElementById ( "elementID" ).innerHTML = "Hello World!" ; Output console .log (a); // write to the browser console document . write (a); // write to the HTML alert (a); // output in an alert box confirm ( "Really?" ); // yes/no dialog, returns true/false depending on user click prompt ( "Your age?" , "0" ); ...
"coding",coding tips and tricks ,Here you can get all coding knowledge and tips and tricks which helps you for coding and learnimg new topics very fast.