你的位置:首页 > 软件开发 > 网页设计 > 用css计算选中的复选框有几个

用css计算选中的复选框有几个

发布时间:2016-09-30 12:00:06
上代码:<!DOCTYPE html><html><head> <meta charset=UTF-8> <title>计数</title> <style type="text/cs ...

上代码:

<!DOCTYPE html><html><head>  <meta charset='UTF-8'>  <title>计数</title>  <style type="text/css">  body{    counter-reset: fruit;  }  input:checked{    counter-increment:fruit;  }  .total:after{    content:counter(fruit);  }  </style></head><body>  <input type="checkbox" name='fruit'>水果  <input type="checkbox" name='fruit'>水果  <input type="checkbox" name='fruit'>水果  <input type="checkbox" name='fruit'>水果  <input type="checkbox" name='fruit'>水果  <input type="checkbox" name='fruit'>水果  <input type="checkbox" name='fruit'>水果  <input type="checkbox" name='fruit'>水果  <input type="checkbox" name='fruit'>水果  <p class='total'></p></body></html>

原标题:用css计算选中的复选框有几个

关键词:CSS

CSS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。