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

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

WBOY
WBOYoriginal
2016-06-24 11:51:001544parcourir

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);

}



Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn