热搜:NVER node 开发 php

自学篇之js 提取复选框和单选框的值 和纯css的3D按钮_html/css_WEB-ITnose

2024-11-15 09:40:01
自学篇之js 提取复选框和单选框的值 和纯css的3D按钮_html/css_WEB-ITnose

button

a.button{

position:relative;

width: 80px;

height: 50px;

background-color: red;

display: block;

text-align: center;

margin: 100px auto;

border-radius:8px;

box-shadow:0px 9px 0px rgba(219,31,5,1),0px 9px 9px #333;

text-decoration: none;

}

a.button:ACTIVE {

position:relative;

width: 80px;

height: 80px;

background-color: red;

display: block;

text-align: center;

margin: 100px auto;

border-radius:8px;

box-shadow:0px 2px 0px rgba(219,31,5,1),0px 2px 9px #333;

text-decoration: none;

}

click

1

2

11

12

13

function chk() {

var value="";

var obj=document.getElementsByName('checkbox');

for(var i=0; i

if(obj[i].checked){

if(i==obj.length-1)

value+=obj[i].value;

else value+=obj[i].value+"和";

}

}

alert("您选择的是:"+value);

}

function singlechk() {

var s="";

var obj=document.getElementsByName('radio');

for(var i=0;i

if(obj[i].checked)

s+=obj[i].value;

}

alert("您选择的是:"+s);

}