Writing maintainable Object-Oriented (OO) JavaScript will save you money and make you popular. Don't believe me? Odds are that either you or someone else will come back and work with your code. making that as painless an experience as possible will
However, DOM. style can only access , so that the built-in style in the label is, if the style is written in the and .css files, you can read the style.In fact, there are other ways to read the style information. There are two methods, one is
Each attribute in this object represents a changeable style attribute (such as "height", "top", or "opacity "). Note: All specified attributes must be in the form of camels. For example, marginLeft must be used to replace margin-left. The value of
Standard Reference
None.Problem description
Binding events to an element property actually createsInline event processing functions(For example, Alert (this );"...>... ),Inline event processing functionsIt has a special scope chain, and the
For more information, see the attachment example.1. cookie functions:Copy codeThe Code is as follows:/*** Cookie operation tool.* Usage: Save value: CookieTool ('name', '1', {expires: 7}) // indicates that a cookie value is saved as 1 and the key
When it comes to object-oriented, we can think of classes, objects, encapsulation, inheritance, and polymorphism. Translated by Cao Li and Zhang Xin in "javaScript Advanced Programming Design" (People's post and telecommunications press.
I. node operations
1. Find nodes:
Var $ var_1 = $ ("htmltype"); // obtain all htmltype nodes.
For example, var $ ul_1 = $ ("ul ");
2. Create and append a node:
Var $ var_1 = $ (""); // create a node.
$ ("Htmltype2"). append ($ var_1); // inserts a
In the project, the left menu is folded and displayed, which is common in the software interface (it would be okay to copy a piece of code on the Internet. It is better to write than me, but to learn, you must have a learning spirit ^ !),I used.
Address: http://www.davidflanagan.com/2009/08/string-multipli.htmlOriginal Author: David FlanaganIn Ruby, the "*" operator uses a string as the left parameter and a number as the right parameter to implement string duplication. For example, the
Copy codeThe Code is as follows: untitled document 123 display div id method 1 in text form | method 2 for displaying the div id in the text form | display test2 in text form | remove the value attribute of inputTest2 |1. element. attr
Ranges represent an interval of values. The value type just needs to be "compatible," that is, to implement a succ method letting us step from one value to the next (its successor ).Prototype provides such a method for Number and String, but you are
1. Use PNG background in IE6IE6 itself does not know the transparency of PNG images, although there are JS programs that allow IE6 to support PNG transparent backgrounds:Copy codeThe Code is as follows:Function correctPNG (){Var arVersion =
A small user-friendly feature makes it very convenient for users. Therefore, if you want to create a similar website, we recommend that you add some tips.Try this function first:Press the left arrow key to go to: www.baidu.comPress the right arrow
I. Javascript 1. The getYear method of the date objectThe results returned by IE getYear () are the same as those returned by getFullYear (), but ECMA262 explicitly specifies that getYear returns "year-1970 ". Some websites use getYear to return the
It may even mistakenly understand the two functions that implement scheduled calls as something similar to thread, and think that they will execute the called functions concurrently in a time slice, which seems very good and powerful, however, this
For beginners, it is sometimes difficult to find a good learning jQuery website. Therefore, this article collects 8 great jQuery learning websites and recommends them to you.1. Learning jQuery
One of the best jQuery resource blogs, I have gained
Copy codeThe Code is as follows:Var evt = window. event | arguments [0]; We will discuss how to add events in three ways. You may see methods you have never seen before.1. The first method to add events is to directly write JS Code in html
closure demonstration product 0 product 1 product 2 product 3 product 4 [Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]The above scenarios are common for beginners. That is, you
Code:Var ie =! + "\ V1 ";Only 7 bytes! See this article, "32 bytes, ehr... 9, ehr... 7 !!! To know if your browser is IE, describes how foreigners reduce IE's judgment from 32 bytes to 7 bytes step by step! StoryBut this record was broken by a
Although it is not commonly used, we can add the attribute named "Number" to the object:Copy codeThe Code is as follows:Var obj = {};Obj [0] = 1;Obj [1] = 2; This object is not an array type. Is there any way to convert it to an array type? In
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