LAYTPL is a subversive JavaScript template engine, which uses ingenious implementations to make its size small and compact, not only in terms of performance, but also with almost every feature of the traditional front-end engine. All the
This is mostly used in form fields, so the experiment I'm doing here is only for form fields. Loop through the child elements of the form to find the first field that is not a hidden field, and then use the focus method to get focused. (hehe ^_^,
The following text:Program design will often run into a situation, that is, you can not know beforehand what data users will need, must be based on user selection and then from the service
Is fed back to the user after the data is extracted. For
Front Code
Copy Code code as follows:
var A;
function Checkall () {
if (a==1)
{
for (Var i=0;i{
var e = form1.elements[i];
E.checked =false;
}
a=0;
}
Else
{
for (Var i=0;i{
var e = form1.elements[i];
E.checked =true;
}
There is no technical innovation in this article, as long as a bit of JavaScript technology can be written.
First step:In the page view the source code, the form contains the need to fill in the HTML control to find out as follows:
Step Two:
According to my consistent web development style, all events that do not directly manipulate the database are implemented by JavaScript as much as possible, so I'm going to use JS to do this.
First of all, to analyze the specific situation: This
A. Testing Environment
Browser: ie6+, FF 3.5.5, Opera, Chrome 4.0.249, Safari 4.0.3
two. Examples
Copy Code code as follows:
three. Solution (I think of the method is to change the way to obtain, based on Yui)
When a form is displayed above the page, usually the focus is not on the first control, and it can be achieved with just a little common script.
Document.forms[0].elements[0].focus ();
If the first control on the page is a hidden field, or it does
The following code implements a message that prompts for input when the user stays in the text input box, increasing the user's degree of adhesion.
Before you enter the content, display as shown in Figure 1
Figure 1
When the User Name text
insert title here &L t;tr> a b c d e f g h i j k j m n > "style=" width:40px "onclick=" AddAll () "/ > " onclick= "Add ()"/&G
T &L t;/p>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh
javascript controls the value of the text box continuously plus minus
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Realistic JS picture countdown, showing the remaining hours, minutes, seconds. Only a picture is done, and pure web version of the same OH. Now use the picture simulation led effect, really good, I hope we thoroughly like OH.
Realistic
For example: Date.parse ("2000-01-01") IE and Mozilla browser: "NaN". Then the time we normally display on a Web page cannot be directly converted. Need to do the processing.
can be directly converted to the format "01/01/2000", "2000/01/01"
dateselector body {margin:0px;
padding:0px;
font-size:12px;
#year, #month, #date {width:60px;
margin-right:3px; }
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to
1: Often related to date conversion comparison:
Copy Code code as follows:
2: Format judgement of the date
Copy Code code as follows:
Yyyy-mm-dd
if (!/^\d{4}\-\d\d?\-\d\d?/.test
The effect of a picture change in a Web page
Paste directly into the browser's address bar to see the effect of the operation
Remember to open a page with many pictures first
Copy Code code as follows:
javascript:r=0; x1=.1; y1=.05; x2=.25;
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