jQuery判斷是否選中

2022-09-10 09:54:18 字數 4442 閱讀 2782

1.判斷check是否選中

doctype html

>

<

html

lang

="en"

>

<

head

>

<

meta

charset

="utf-8"

>

<

title

>判斷check是否被選中

title

>

<

meta

name

="viewport"

content

="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"

/>

<

meta

content

="yes"

name

/>

<

meta

content

="black"

name

/>

<

meta

content

="telephone=no"

name

="format-detection"

/>

<

style

type

="text/css"

>

*bodya/*

btn*/

.public_btn_s

.public_btn_s a

style

>

head

>

<

body

>

<

div

class

="public_agreement"

>

<

input

type

="checkbox"

id="agreeinput"

value

="on"

>同意<

a href

="j**ascript:;"

>個人隱私協議

2.判斷div是否被選中

doctype html

>

<

html

lang

="en"

>

<

head

>

<

meta

charset

="utf-8"

>

<

title

>判斷div是否被選中

title

>

<

meta

name

="viewport"

content

="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"

/>

<

meta

content

="yes"

name

/>

<

meta

content

="black"

name

/>

<

meta

content

="telephone=no"

name

="format-detection"

/>

<

style

type

="text/css"

>

*bodya/*

選項卡*/

.form_tab

.ft_top

.ft_top a

.ft_top a:last-child

.ft_top a:hover,.ft_top a.current

.ft_top a.current

.ft_con

.ft_con a

.ft_con a.current

/*btn

*/.public_btn_s

.public_btn_s a

style

>

head

>

<

body

>

<

div

class

="form_tab"

>

<

div

class

=" ft_top"

id="tabmenu"

>

<

a href

="j**ascript:;"

class

="current"

>轉盤法(排盤法)

a>

<

a href

="j**ascript:;"

>飛盤法(排盤法)

a>

div>

<

div

class

="ft_con "

id="tabcon"

>

<

a href

="j**ascript:;"

>置潤法

a>

<

a href

="j**ascript:;"

>拆補法

a>

<

a href

="j**ascript:;"

>茅山道人法

a>

div>

div>

<

div

class

="public_btn_s"

>

<

a href

="j**ascript:;"

class

="j_ajax_submit_btn"

a>

div>

<

script

srctype

="text/j**ascript"

>

script

>

<

script

type

="text/j**ascript"

>

$(function

() );

$('#tabcon a

').on(

'click',

function

() );

//按鈕點選$('

.j_ajax_submit_btn

').on(

'click',

function

()else

}});

})script

>

body

>

html

>

效果圖:

判斷是否隱藏

$("#div").is(":visible")

Jquery 判斷 checked 是否選中

如果要判斷js中的 checked 是否選中,首先取決於你引用的 jquery 的版本。首先,我引用的是 jquery v1.11.2 的版本出現的效果如下 建議 選用 jquery 1.8.3.min.js 會比較穩定點 charset utf 8 title head type checkbox...

JQuery判斷CheckBox是否選中

function checkvalidity return true var checkusername checkusername is checked var checkoperatetime checkoperatetime is checked var checkdescriptioninc...

JQuery判斷CheckBox是否選中

function checkvalidity return true var checkusername checkusername is checked var checkoperatetime checkoperatetime is checked var checkdescriptioninc...