jq實現批量全選與反選

2022-05-07 13:00:13 字數 2640 閱讀 1853

doctype html

>

<

html

lang

="en"

>

<

head

>

<

meta

charset

="utf-8"

>

<

title

>document

title

>

head

>

<

body

>

<

input

type

="button"

value

="刪除"

>

<

table

border

=1>

<

thead

>

<

tr>

<

th><

input

type

="checkbox"

>

th>

<

th>2

th>

<

th>3

th>

<

th>4

th>

tr>

thead

>

<

tbody

>

<

tr>

<

td><

input

type

="checkbox"

>

td>

<

td>打兩份工

td>

<

td>真的很高

td>

<

td><

button

>刪除

button

>

td>

tr>

<

tr>

<

td><

input

type

="checkbox"

>

td>

<

td>打兩份工

td>

<

td>真的很高

td>

<

td><

button

>刪除

button

>

td>

tr>

<

tr>

<

td><

input

type

="checkbox"

>

td>

<

td>打兩份工

td>

<

td>真的很高

td>

<

td><

button

>刪除

button

>

td>

tr>

<

tr>

<

td><

input

type

="checkbox"

>

td>

<

td>打兩份工

td>

<

td>真的很高

td>

<

td><

button

>刪除

button

>

td>

tr>

<

tr>

<

td><

input

type

="checkbox"

>

td>

<

td>打兩份工

td>

<

td>真的很高

td>

<

td><

button

>刪除

button

>

td>

tr>

<

tr>

<

td><

input

type

="checkbox"

>

td>

<

td>打兩份工

td>

<

td>真的很高

td>

<

td><

button

>刪除

button

>

td>

tr>

tbody

>

table

>

body

>

<

script

src=""

>

script

>

<

script

>

$(function

());

});});

$(function

());

});});

script

>

html

>

jq 實現全選反選,獲取選中的值

function input name chk list normal on click function else 一般專案實現全選 實現全選反選 chk all on click function input name chk list on click function else div cl...

關於全選 反選,批量刪除

全選 反選 function checkopposite else function deletesome console.log id.substring 1 獲取id的第二種方式 map 將jquery集合轉換成其他陣列 get 將其他陣列轉換成js陣列 join 將陣列中的元素拼成字串,如果不...

jq 全選 反選 判斷選中的條數

1 全選或全不選。當勾選全選按鈕 selectall旁邊的核取方塊 all時,列表中的選項全部選中,反之取消勾選則列表中的選項全部為未選中狀態。all click function else 2 全選。當點選全選按鈕 selectall或者勾選全選按鈕旁邊的核取方塊 all時,列表中所有的選項都會被...