Button not available
Button can not be used disabled not be able to use the meaning
btn.disabled = "Disabled" | | Btn.disabled = true;
Grey
Attention:
- Because the button is a double label, you want to change his value, using InnerHTML, not value.
- Turn off timer clearinterval (timer name); The timer is no longer
SetTimeout of the timer ()
SetInterval (fn,5000); each interval 5 seconds, go to execute function fn One time
SetTimeout (fn,5000); after 5 seconds, go to the FN function and execute only once
A deeper view of the timer difference
SetInterval is queued for execution.
1 seconds, and the time of the executed program is 2 seconds The last code that was not executed is queued is executed immediately. This is the actual execution interval of 2 seconds
The SetTimeout delay time is 1 seconds , and the code to execute takes 2 seconds to execute , The last time the code is executed is 3 seconds .
operator
Unary operator + +, ---+-+5-6
logical Operators ! && | |
basic operator +,-, *,/,%
relational operator , <, >=, <=, = = =, =,! =,!==
= value = = = = = = = =
conditional operator (ternary operator) ? :
assignment operator + =,-=, *=,/=,%=
A+=5 A= A + 5
comma operator , var a=0,b=0;
String Object Common method conversion to string
1. + "" "" "" "=" 2 "" "AB" = "2ab"
2. String () conversion to Strings
3. ToString(base) ; Cardinality is the binary
var txt = 10;
Txt.tostring (2) binary 1010
get character position method
CharAt, gets the corresponding position character (argument: character position)
charCodeAt get the corresponding position character Unicode encoding (parameter: Character position)
- button not available disabled = "Disabled" | | True
- SetTimeout only executes once setinterval executes many times
- Recursive invocation : The function calls itself function recursive call does not advocate the function name But like to use the Arguments.callee return is executing functions itself
- logical Operators with && or | | No! ! > && > | |
- 2&&0 0 1&&8 0&&3 0 1| | 0
- converted to Character Type
var num = 12345;
num+ ""
String (num);
Num.tostring (); Ten- Step system
Num.tostring (2) binary
- returns characters based on character position
CharAt ( index number )
var txt = "ABCDE";
Txt.charat (3); D
charCodeAt (3) Unicode encoding
Front-end basic-javascript sixth day