The principle is: the general use of traversal method to determine whether each radio is selected, if it is, and then take its value.
1
2 "3
Note that the above needs to be aware that the ID (userlist) is set in the form
Here are
There are no events (such as Click,mouseover) in the 1,IE6/7/8/9, and Firefox/safari/chrome/opera.
Copy Code code as follows:
1
2
Example:
12
2, click Option to get the event source target via srcelement
The examples in this article describe the method by which the JavaScript implementation makes the relevant input box dimmed when the check box is selected. Share to everyone for your reference. as follows:
This feature is often seen on some
First of all, review the next article high-performance JavaScript DOM programming , mainly two point optimization, one is to minimize access to the DOM, while the operation on the ECMAScript side, the second is to cache local variables, such as
No more nonsense, first effect chart:
View Demo Source Download
Code in JavaScript
var spans=document.getelementsbytagname ("span");
var flag=5;//this value arbitrarily take, as long as not 01234 on line var expand=function () {//Extension
Create an array
There are several ways to declare an array in JS:
var arr = []; Shorthand mode
var arr = new Array ();//new Array object
var arr = new Array (arraylength);//new Array object of a certain length
To illustrate the
On the web side, there is usually no right-click menu, and each browser has its own right-click menu. But for some special pages, it is necessary to right-click menu to increase the user experience, such as Baidu Music, QQ mailbox, I believe that
Do you often listen to senior or some front-end predecessors said that can not use CSS wildcard *,CSS selector cascade can not be more than three layers, CSS as far as possible using class selector, writing HTML less use table, the structure should
Copy Code code as follows:
var Odatef = new Date ();
Odatef.setfullyear (2012);
Odatef.setmonth (5)
Odatef.setdate (1);
Fday = Ordatef.getday ();
If today is May 30, through the above code, I should be getting to the next
Write casually! Idle, bored! If the code has bugs, you are welcome to make a strong shot of bricks!
JS CODE
Copy Code code as follows:
HTML CODE
Copy Code code as follows:
date demo
A simple picture amplification effect:
Parameter description:
1.berviary:string, need to be magnified picture ID
2.expand:object, enlarge the area, if this key is not set or the ID of this item is not set, the default is cursor follow mode, and the
1, how to create hyperlinks in Javasript
2, apply to the tree control event handling in Ext
Tree_03.js
Copy Code code as follows:
Ext.onready (function () {
var root = new Ext.tree.TreeNode ({//tree, there is no function, using
var patterns = {
Hyphen:/(-[a-z])/I,
Root_tag:/^body|html$/i
};
var Tocamel = function (property) {
If there is no-[a-z] letter, return directly
if (!patterns. Hyphen.test (property)) {
return property;
}
If there is a cache, return the
We will overwrite the factory pattern with the constructor pattern.
Copy Code code as follows:
function Employee (name, age, Job) {
THIS.name = name;
This.age = age;
This.job = job;
This.sayname = function () {
alert
Today is the last section, which describes not using constructors to implement inheritance.
One, what is the "non-constructor" inheritance?For example, now there is an object called "Chinese".
Copy Code code as follows:
var Chinese =
Copy Code code as follows:
var jsobject = {} | | New Object ();
Jsobject.extend = function (subclass, superclass) {
First, determine if the subclass subclass is already defined, or redefine the class if it is undefined.
if (typeof subclass =
A little question today: how do I get the return value of a JavaScript asynchronous function?
1. Wrong attempt
My initial attempt when I did not enter:
2. Callback function
The pop-up is not 4, but 0, and then know that this is an
Local variable TrapsLook at the code first:
function foo () {
var a = "Hello"
b = "World"
return a + B;
}
When this function is finished, it returns HelloWorld, and the result is really no problem. But there's a
If you have focus, you must lose Focus. The onblur event and onfocus are relative events when the cursor leaves the current get polyThe onblur event is triggered while the calling program is Executed.The following code, the page has a user and
Web Print summary, web Summary
One requirement in the project is to print the winform client on the webpage by the customer. The printing requirement is implemented according to a certain format.
The solution at that time was to use PDF printing:
1.
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