There are a lot of full selection, the assignment of JS method, but there is no small set to want the code, since today used, the code posted out to share. JS Code:
The code is as follows
Copy Code
TML Code:
JavaScript custom events are customized events that differ from standard events such as click, submit, and before describing the benefits of custom events, look at an example of a custom event:
The code is as follows
Copy Code
Local JavaScript variable
A variable declared inside a JavaScript function (using VAR) is a local variable, so it can only be accessed within the function. (The scope of the variable is local).You can use local variables with the same name in
For developers, date may sometimes be important, and we can create a date object from the new date (). For example:
The code is as follows
Copy Code
var start = new Date (),//Get current timeToday = new Date (2013,6,6),//
Here are some more "esoteric" topics to try to understand the reasons. Written "Easy to understand", not science and technology, and not so rigorous, the expression is not good. No way, Chinese did not learn:(
Programmers, no way, the habit of
There are many ways to intercept a string (excluding the split () method that intercepts a number of groups based on incoming parameters) here is a substring, so do not say the split () method.
Slice (), substr (), substring () altogether three
Program code
The code is as follows
Copy Code
function Checkpasswordreg (s) {if (/^\d{6}$/.test (s)) {//not 6 digitsreturn false;}if (/^[a-z]+$/.test (s)) {//All in Englishreturn false;}if (s== "| | s.length==0) {return
Remove spaces
The code is as follows
Copy Code
var str= str.replace (^\s*) | ( \s*$)/g, "");
Add
The code is as follows
Copy Code
Add:
The code is as follows
JS Countdown end jump to the specified URL, looks like the countdown and no difference, just a jump function, originally thought this function is too simple, not worth sending, but yesterday happened to have a person asked me this question, the
The code is as follows:
function Checkall (val) {
$ ("Input[name= ' Chkjob ']"). each (function () {
this.checked = val;
});
$ ("#chkAll"). attr ("Checked", Val);//Set all Select button Status
}
Val, this parameter passes the
var str= "Hello";str+= "World";In fact, the steps that this code performs behind the scenes are as follows:(1) Create a string that stores "Hello".(2) Create a string that stores "world".(3) Create a string that stores the result of the connection.(4
JavaScript Tutorial Password Validator
The following check function, the password field is blank, only allow letters and numbers-this time no underscopes. Therefore, we should use a new regular expression to prohibit underscopes. These 1/[w_]/Only
Tip: You can modify some of the code before running
Practical JavaScript Progressive text scrolling effect and between--> and > Company Address: No. 178th, Happy Middle Road, Zhifu District, Yantai Office Tel:0535-6806933 Fax
Tip: You can modify some of the code before running
javascript discontinuous and uninterrupted text scrolling effect and --> and --> First line second line Third Line ;/li> First line & Lt;/li> second line Third
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service