謝晒的PHP網頁設計
聯絡E-mail:
sean0704@gmail.com
站內搜尋
Thursday, January 29, 2015
[JavaScript] 抓有相同 name 的 checkbox 被選取的值
var c = document.getElementsByName('mycheckbox[]');
var len = c.length;
for (var i=0; i<len; i++) {
if(c[i].checked) {
alert(c[i].value);
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment