JS 樣式疊加顯示

2022-09-07 23:54:28 字數 4880 閱讀 1068

doctype html

>

<

html

>

<

head

>

<

meta

charset

="utf-8"

>

<

title

>

title

>

<

style

type

="text/css"

>

*#aa

#a1#a11

#a111

#a12

#a112

#a2#a21

#a22

#bb#b1

#b2#b21

#b211

#b22

#b231

#b224

#b241

#b23

#b24

#b3#b31

#b32

#cc#c

#c1#c11

#c111

#c112

#c113

#c114

#c115

#c12

#c121

#c122

#c123

#c124

#c125

#c1211

#c1212

#c1213

#c1214

#c1215

#c2#c21

#c22

style

>

head

>

<

body

>

<

div

id="aa"

>

1、innerhtml 的基本用法

<

div

id="a1"

>

<

div

id="a11"

>

<

input

type

=""name

="a111"

id="a111"

value

=""/>

div>

<

div

id="a12"

>

<

input

type

="submit"

name

="a112"

id="a112"

value

="提交"

onclick

="b1()"

/>

div>

div>

<

div

id="a2"

>

<

div

id="a21"

>

提交後在這裡顯示:

div>

<

div

id="a22"

>

div>

div>

div>

<

div

id="bb"

>

<

div

id="b1"

>

2、innerhtml、字串、判斷的基本應用

div>

<

div

id="b2"

>

<

div

id="b21"

>

<

input

type

=""name

="b211"

id="b211"

value

=""/>

div>

<

div

id="b22"

>

+

div>

<

div

id="b23"

>

<

input

type

=""name

="b231"

id="b231"

value

=""/>

div>

<

div

id="b24"

>

<

input

type

="submit"

name

="b241"

id="b241"

value

="提交"

onclick

="b2()"

/>

div>

div>

<

div

id="b3"

>

<

div

id="b31"

>

提交後在這裡顯示:

div>

<

div

id="b32"

>

div>

div>

div>

<

div

id="cc"

>

3、陣列輸出練習

<

div

id="c1"

>

<

div

id="c11"

>

<

div

id="c111"

>

已知陣列內容:

div>

<

div

id="c112"

>

1、這是第一句話

div>

<

div

id="c113"

>

2、這是第二句話

div>

<

div

id="c114"

>

3、這是第三句話

div>

<

div

id="c115"

>

4、這是第四句話

div>

div>

<

div

id="c12"

>

<

div

id="c121"

>

<

input

type

="submit"

name

="c1211"

id="c1211"

value

="提取1"

onclick

="b3()"

/>

div>

<

div

id="c122"

>

<

input

type

="submit"

name

="c1212"

id="c1212"

value

="提取2"

onclick

="b4()"

/>

div>

<

div

id="c123"

>

<

input

type

="submit"

name

="c1213"

id="c1213"

value

="提取3"

onclick

="b5()"

/>

div>

<

div

id="c124"

>

<

input

type

="submit"

name

="c1214"

id="c1214"

value

="提取4"

onclick

="b6()"

/>

div>

<

div

id="c125"

>

<

input

type

="submit"

name

="c1215"

id="c1215"

value

="全部彈出提取"

onclick

="b7()"

/>

div>

div>

div>

<

div

id="c2"

>

<

div

id="c21"

>

提交後在這裡顯示:

div>

<

div

id="c22"

>

div>

div>

div>

body

>

html

>

<

script

type

="text/j**ascript"

>

function

b1()

function

b2()

function

b3()

function

b4()

function

b5()

function

b6()

function

b7()

script

>

CSS樣式疊加

css可以把多個樣式加到同乙個元素上。如果多個樣式有重合,瀏覽器會根據權重的大小進行樣式覆蓋,這就是層疊樣式表的由來。下面我們先來看一下疊加是怎麼回事。doctype html html lang en head meta charset utf 8 meta name viewport conte...

js 控制樣式顯示隱藏

默然是隱藏的input 當style.display block 或style.visibility visible 時控制項或見,當style.display none 或 style.visibility hidden 時控制項不可見。不同的是 display 不但隱藏控制項,而且被隱藏的控制項...

leaflet 載入geojson疊加顯示

geojson需要先製作shp,然後匯入下面 生成geojson。geojson,最好放後台,前台通過非同步請求去載入json,然後顯示。getgeojsonbyname then data this.bondarylayer l.geojson data,pane overlaypane this...