First, JS function
Because there are more things to learn, easy to confuse. Also can not be remembered, here notes, later to use the time, will be able to quickly recall.
Index-number.js
/** * Display Digital Object */function myFunction () {var x1 = 3.14;//decimal var x2 = 11;//integer var x3 = 14e5;//large number var x4 = 0237;//octal var x5 = 0x12f;//hex var y = 0.1 + 0.2;var str = "x1:" + x1 + "<br/>x2:" + x2 + "<br/>x3:" + x3 + "<BR/>X4:" + x4+ "<br/>x5:" + x5;document.write (str + "<br/>");d ocument.write (y);} /** * Display String Object */function MyFunction2 () {var str= "<p> This is the text content of the JS object </p>"; var str2= "Black"; var str3= " This is the text content of the JS object "document.write (Str.italics ());//The text is Italic document.write (Str.fontcolor (" #ff0000 "));//The text color is red, Note the case document.write (Str.link ("http://www.baidu.com"));//Click on the link of the content Jump document.write (Str.bold ());// The text is in bold document.write (Str2.tolocalelowercase ());//Lowercase document.write (str2.touppercase ());//Uppercase document.write ( Str.fontcolor ("Red"). FontSize (20));//change both the text color and the font size document.write (str3.fontsize (+) + str2.sub () +str3.fontsize (20 ) +str2.sup ());//superscript and subscript document.write (str.replace ("JS", "JavaScript");//Replace}
JS (ii) numeric objects and string objects