Implementation of Javascript Cascade

Source: Internet
Author: User

When it comes to cascade, read the following code:

Set ("UserDiv ").
Width (160 ).
Height (26 ).
Border ("1px solid # ff0000 ").
Background ("#00ff00 ");

It may be a bit familiar. If you use jquery or have read some jquery code, you should have seen similar usage methods. This is returned for each method during cascade operations, so many methods can be called in one statement in sequence.

For JavaScript cascading, Google has searched out completely unrelated content, all of which are JavaScript cascading menus. Baidu does not need to mention them, but also does not touch edge content. There is no very reliable information for the moment, so I wrote one myself. If there is anything wrong, please give more advice.

<Script type = "text/javascript">
Var person = function (){};
Person. prototype. name = function (name) {this. name = name; return this ;}
Person. prototype. age = function (age) {this. age = age; return this ;}
Person. prototype. sex = function (sex) {this. sex = sex; return this ;}
Person. prototype. holobby = function (holobby) {this. holobby = holobby; return this ;}
Var tom = new person (). name ("tom"). age (16). sex ("male"). holobby ("Write Javascript Code .");
Alert (tom. holobby );
Alert (tom. age );
</Script>

Running example:

<Br/> <center> If the page cannot be displayed, press Ctrl + F5 to refresh the page. For more webpage code: <a href = 'HTTP: // www.bkjia.com/'title = "bkjia.com" target = '_ blank'> http://www.bkjia.com/</a> </center>

Tip: the code can be modified before running!

Article from: http://www.wxwdesign.cn/

Related Article

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.