<MCE: Script Type = "text/JavaScript"> <! -- <Br/> $ (document ). ready (function () {<br/> $ ("# formstylecontrols select "). change (function () {<br/> alert ($ (this ). ATTR ("ID") + "" + $ (this ). val (); <br/> $ ("p" ).css ($ (this ). ATTR ("ID"), $ (this ). val (); </P> <p> // a trick is used here: the select ID is consistent with the CSS attribute value to be set, you can use one statement to implement the three select functions </P> <p >}); <br/> // --> </MCE: SCRIPT> <br/> </pead> <br/> <body> <br/> <Div id = "formstylecontrols"> <br/> <label for = "font- size "> font size </Label> <br/> <select id = "font-size"> <br/> <option value = "12px"> small </option> <br/> <Option value = "14px"> relatively small </option> <br/> <option value = "16px"> medium </option> <br/> <option value = "18px"> relatively large </option> <br/> <option value = "24px"> large </option> <br/> </SELECT> </P> <p> <label for = "background"> background color </label> <br/> <select id = "background"> <br/> <option value = "# f4fbff"> default </option> <br/> <option value = "# f0f0f0"> light gray </Option> <br/> <option value = "# eaeaea"> gray </option> <br/> <option value = "# eefaee"> green </option> <br/> <option value = "# ffffed"> minghuang </option> <br/> </SELECT> </P> <p> <label for = "color"> font color </label> <br/> <select id = "color"> <br/> <option value = "#000000"> black </option> <br/> <option value = "# ff0000"> Red </option> <br/> <option value = "#006600"> green </option> <br/> <option value = "# 0000ff"> blue </option> <br/> <option va Lu E = "#660000"> brown </option> <br/> </SELECT> <br/> <label> </P> <p> </label> <br /> </div> <br/> <H2> Chapter 1: cold Palace Resentment </H2> <br/> <p> November 3, March, clear Spring Day </P> <br/> <p> today is the emperor's wedding ceremony. </P> <br/> <p> wanren kongxiang, Jinling City, the people and officials all came out to watch the Emperor's reception ceremony. On this day, according to the Emperor's will, Feng mizhi, the daughter of the royal family, was used to marry le ting Hou's house. Before Feng Yu, the deputy armed guards opened the road, and the martial arts were solemn; after that, the women were armed with colored clothing and flowers. Busy and bustling, Xiang Yan is envious of a whole street. The pair of yarn palace lights were exceptionally dazzling, and the band's high performance welcomed the music. The sound of the silk bamboo was deafening, pushing the warm-up atmosphere to a climax. </P> <br/> <p> the welcoming team of haohaojie turned to the main streets of Jinling city, then, Feng miaizhi, the new queen of the limelight, was sent to the gentle Hall of the cave house selected by the emperor. He Xi's ministers, friends and friends have already retired. Soon, the emperor will join hands in the cave room to spend the Spring Festival together ...... </P> <br/> <p> at this moment, I am standing on the big pasture between the Landscape Water and the Weishui water. at the foot of my feet, there are three small squares paved with huge ancient slate, in the front of the pine tree, the Green Tree is a cold neigon, that is, the last home that once loved me by my king. </P> <br/> <p> my 24-year-old life suddenly became so illusory. It was like the most beautiful flower, but it had not yet reached its peak. </P> <br/> <p> the harem is a huge garden with fresh Yan in every season. No woman is always unbeaten. If I used to belong to "Spring", now it's time to go back to another person's "Summer"-My flower season, and it's quietly called off. </P> <br/> <p> I am 18-24 years old and have the youngest and most colorful years in my life. I am filled with rouge water powder in the Tang Dynasty harem, in the no smoke, but full of thrilling and exciting princess battles, once a strong rise, pet crown three thousand. </P> <br/> <p> However, at that time, I did not expect that spring was so short. </P> <br/> <! -- <Br/> the stringjavascript string CSS (string name) accesses the style attribute of the First Matching Element. Detailed description <br/> access the style attribute of the First Matching Element. Using this method, you can easily obtain the value of the style attribute of the First Matching Element. <Br/> [Example]: <br/> obtain the value of the Color Style attribute of the first section. </P> <p> $ ("p" ).css ("color"); <br/> HTML Tag: <br/> <P style = "color: red; "mce_style =" color: red; "> test paragraph. </P> <br/> result: <br/> "red" <br/> [Example]: <br/> obtain the font-weight style attribute value of the first section. </P> <p> $ ("p" ).css ("font-weight"); <br/> HTML Tag: <br/> <P style = "font-weight: bold;" mce_style = "font-weight: bold;"> test paragraph. </P> <br/> result: <br/> "bold" </P> <p> jqueryjquery object CSS (the properties of the JavaScript Object represented by map attributes and values in the form of "property/value" pairs must be set as the style attribute name/value pair object) set a "name/value pair" object to the style attribute of all matching elements. Detailed description <br/> set a "name/value pair" object to the style attribute of all matching elements. </P> <p> This is the best way to set a large number of style attributes on all matching elements. <Br/> [Example]: <br/> set the color and background style attributes for all P elements. </P> <p> $ ("p" ).css ({color: "red", Background: "blue"}); <br/> HTML Tag: <br/> <p> test paragraph. </P> <br/> result: <br/> <P style = "color: red; Background: Blue;" mce_style = "color: red; Background: blue; "> test paragraph. </P> <p> jqueryjquery object CSS (the style attribute name to be set for the stringjavascript string key, objectjavascript object. Example: string or number Instance value) in all matching elements, set the value of a style attribute </P> <p> --> <br/> </body>
Note: This code mainly uses CSS (name, value) to dynamically change the font size.