number类型的input样式修改及绑定左右按钮
2020-07-12 17:12
1251 查看
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Jay Skript And The Domsters</title> <style type="text/css"> *{border:none;margin:0px;padding:0px;} .number{ padding: 36px 0 28px;width:400px;margin:auto} .minus{width: 30px; height: 30px; text-align: center;border: solid 1px #eaeaea; background: #f5f5f5; color: #9e9e9e;} .numbox{border-top: solid 1px #eaeaea; border-bottom: solid 1px #eaeaea; height: 28px; width:60px; color: #333333; margin-left:-8px; text-align: center; background: transparent;} .plus { margin-left: -8px;} </style> </head> <body > <div class="number"> 购买数量: <div class="mui-numbox"> <button class="minus" type="button" οnclick="opera('val', false);">-</button> <input class="numbox" type="number" id="val" value="0"/> <button class="minus plus" type="button" οnclick="opera('val', true);">+</button> 人次 </div> <script type="text/javascript"> function opera(x, y) { var rs = new Number(document.getElementById(x).value); if (y) { document.getElementById(x).value = rs + 1; } else if( rs >0) { document.getElementById(x).value = rs - 1; } } </script> </body> </html>
转载于:https://www.cnblogs.com/renewload/p/11227302.html
相关文章推荐
- 取消input(number类型)输入框上下按钮
- input file类型自定义样式-按钮
- 修改input file类型的默认按钮
- 利用Javascript来修改file类型input标签的样式
- 如何让input number类型的标签不产生上下加减的按钮
- 只修改input file组件的浏览按钮样式
- 图片提交按钮样式修改 input type=file
- 移动web端<input type="number">手机上点击直接打开数字键盘,并修改样式去除最右端上下箭头
- 只修改input file组件的浏览按钮样式
- input file按钮样式修改
- 在移动HTML5页面input类型采用number无法控制长度,以及右边显示难看的加减按钮
- Quasar Input:type="number" 去掉上下小箭头 实现加减按钮样式功能
- 修改提交文件的input类型为file控件的样式
- 定义 input 中 file类型的 按钮的样式
- html去掉number类型input右侧的加减按钮
- JavaScript input file类型自定义按钮样式
- 在vue组件的stylus样式总 取消search类型的input按钮中默认样式
- 修改 上传图片按钮input-file样式。。
- 修改input file的样式(或用按钮button替代file)
- CSS3样式控制input按钮效果