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

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

WBOY
WBOYOriginal
2016-06-24 11:51:001543Durchsuche

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

}



Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn