如何在复选框选择中自动添加图书价格 [英] how to add book prices automatically on checkbox selection

查看:47
本文介绍了如何在复选框选择中自动添加图书价格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个带复选框选项的课程列表。我需要根据复选框选中并取消选中总价。我需要申请jquery函数到我的html页面。请尽快帮助我。

解决方案

去这个jsfiddle你会得到你需要的东西。

并且请一定要玩这个,所以你会理解并且可以在许多其他场景中实现更好。



http://jsfiddle.net/fQTUp/9/ [ ^ ]



干杯


 <  输入    type   = 复选框  < /跨度> <跨度class =code-attribute> value   =  1000     名称  =   HTML    id  < span class =code-keyword> =  1      class   =  >  HTML <   br     /  >  < span class =code-keyword><   br     /  >  
< 输入 type = 复选框 名称 = C value = 1500 id = 2 class = box > C#< br / > < br / >
< 输入 类型 = 复选框 name = JQuery value = 2000 id = 5 class < span class =code-keyword> = box > JQuery < br / > < br / >
< 输入 < span class =code-attribute> type = button id = GetTotal value = 获取总金额 > < br / >





 


(文件)。就绪(函数(){

Hi Everyone,

I have a list of courses with checkbox options.I need to get the total price as per checkboxes checked and unchecked.I need to apply jquery function to my html page.Please help me out soon.

解决方案

go for this jsfiddle where you will get what you need.
and please do play around with this, so you will understand and can implement in many other scenarios for your better.

http://jsfiddle.net/fQTUp/9/[^]

Cheers


<input type="checkbox" value="1000"  name="HTML" id="1"  class="box">HTML<br /><br />
<input type="checkbox"  name="C" value="1500" id="2"  class="box">C#<br /><br />
<input type="checkbox"  name="JQuery" value="2000" id="5"  class="box">JQuery<br /><br />
<input type="button" id="GetTotal" value="Get total amount"><br />




(document).ready(function(){


这篇关于如何在复选框选择中自动添加图书价格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆