07.30 "JQuery"--1.4 modifying CSS Styles

Source: Internet
Author: User

1. Single-Change style

<!DOCTYPE HTML><HTML>    <Head>        <MetaCharSet= "UTF-8">        <title></title>        <styletype= "Text/css">#aaa{Height:100px;width:100px;Background-color:Red;            }        </style>        <Scriptsrc=".. /jquery-3.2.1/jquery-3.2.1.js "type= "Text/javascript">                    </Script>        <Scripttype= "Text/javascript">            $(function(){                $("#btn"). Click (function(){                    $("#aaa"). css ({"Height": $,                        "width": $,                        "Background-color":"Yellow"                    })                })            })        </Script>    </Head>    <Body>        <DivID= "AAA">yo yo yo ~~man,come on! </Div>        <inputtype= "button"name= "BTN"ID= "BTN"value= "Press Me to change format" />    </Body></HTML>

The result of this modified style is

--------------》

This way is only a single change CSS style one or more properties

2. Modify the entire set of styles

<!DOCTYPE HTML><HTML>    <Head>        <MetaCharSet= "UTF-8">        <title></title>        <styletype= "Text/css">#aaa{Height:100px;width:100px;Background-color:Red;            }#bbb{Height:300px;width:300px;Background-color:AliceBlue;            }        </style>        <Scriptsrc=".. /jquery-3.2.1/jquery-3.2.1.js "type= "Text/javascript">                    </Script>        <Scripttype= "Text/javascript">            $(function(){                $("#btn"). Click (function(){                    $("#aaa"). attr ("ID","BBB"); })            })        </Script>    </Head>    <Body>                          <DivID= "AAA">yo yo yo ~~man,come on! </Div>        <inputtype= "button"name= "BTN"ID= "BTN"value= "Press Me to change format" />    </Body></HTML>

is to convert the entire CSS style code to another CSS style, which transforms the entire style.

07.30 "JQuery"--1.4 modifying CSS Styles

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.