JS Study note 2015-4-15 (next day)

Source: Internet
Author: User

Two (number 14th), JS attribute operation notes:

1, all the relative path, do not take to make judgments, that is, the relative path can not be read (but can write operations)

2, color value also do not take to make judgments (there will be compatibility issues);

3, innerHTML value do not take to make judgments;

4, IE6, IE7, IE8, does not support changing the type of input, compatibility will be problematic;

Hint idea: If insist to do, can consider using other methods, cleverly avoid some problems, achieve the effect visually;

5, change the floating problem of elements:

Under IE: is the variable name. Style.stylefloat:left/right;

Non-ie: is the variable name. Style.cssfloat:left/right;

Tip: If you want to change the value of a floating property of an element, you can first define two floating styles, such as:

. left{Float:left}

. Right{float:right}

<div class= "ClassName" ></div> this time, you can use JS to control the call to use the ClassName name on it, there will be no compatibility problem;

Work in accordance with user needs to solve the problem, the idea to be flexible!!!

Technology to master the compatibility problem of the solution, from the requirements, can provide the best solution;

Third, the use of brackets;

[] The value can be easily modified, very practical

Odiv.style.oattr.value=oval.value; Here, for example, this style doesn't make a difference.

Odiv.style[oattr.value]=oval.value; Use the brackets to

JS allowed to put in.   Replace with []; Tips:[] Inside if the value is quoted, for example: Obtn.value written obtn["value"]

JS Study note 2015-4-15 (next day)

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.