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/