无标题文档 * {text-align: center;} p {font: 30px;} table {border: 1px #000 solid; line-height: 30px;} tr,th,td {border: 1px #000 solid; height: 30px; width: 80px;} input {line-height: 30px; width: 60px; margin-top: 5px;}选举大会
姓名 当前票数 加一 一号 0 二号 0 三号 0 四号 0
想实现按下后面的“加”按钮,“当前票数”就加1,应该怎么弄??
回复讨论(解决方案)
打个酱油 LS解答
简单得很,服务端写好ajax接口,点击时客户端调一下,回调函数中更新下票数就行了,提醒注意做好验证码功能,不然刷票容易得很
简单得很,服务端写好ajax接口,点击时客户端调一下,回调函数中更新下票数就行了,提醒注意做好验证码功能,不然刷票容易得很
额,不用上传服务器的,就是本地用下,剩去划正字的和统计的麻烦,这样票数一目了然,能用JS实现不? 如果要做的带有记录性,那么可以考虑利用cookie存几个特定的值
无标题文档 * {text-align: center;} p {font: 30px;} table {border: 1px #000 solid; line-height: 30px;} tr,th,td {border: 1px #000 solid; height: 30px; width: 80px;} input {line-height: 30px; width: 60px; margin-top: 5px;} $(function(){ $('.add').click(function(){ var countTd=$(this).parent().prev(); var countCur=(parseInt(countTd.html())||0)+1; countTd.html(countCur); }); })选举大会
姓名 当前票数 加一 一号 0 二号 0 三号 0 四号 0
如果要做的带有记录性,那么可以考虑利用cookie存几个特定的值
无标题文档 * {text-align: center;} p {font: 30px;} table {border: 1px #000 solid; line-height: 30px;} tr,th,td {border: 1px #000 solid; height: 30px; width: 80px;} input {line-height: 30px; width: 60px; margin-top: 5px;} $(function(){ $('.add').click(function(){ var countTd=$(this).parent().prev(); var countCur=(parseInt(countTd.html())||0)+1; countTd.html(countCur); }); })选举大会
姓名 当前票数 加一 一号 0 二号 0 三号 0 四号 0
灰常感谢!!
查看更多关于公司选举,打算弄个html来唱票,请帮帮忙!_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did104959