怎么实现淘宝上点击不同的套餐 局部刷新价格的效果 大神给个思路 ajaxjavascriptjquery 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 套餐上搞个自定义属性存储价钱就好了。。点击的时候获取自定义属性值<script> function setPrice(o) { alert(o.getAttribute('price')) }</script></head><label price="50" onclick="setPrice(this)">套餐1</label> <label price="100" onclick="setPrice(this)">套餐2</label> <label price="150" onclick="setPrice(this)">套餐3</label> 输出表单output<br /> <form action="" method="post" oninput="result.value=parseInt(no1.value)+parseInt(no2.value)"> <input type="number" name="no1" value="" /> <input type="number" name="no2" value="" /> <output name="result"></output> </form> 不需要用Ajax做 可以做出来? 为什么要用ajax呢?没什么必要啊。。除非你为了防止采集数据什么的,给采集者增加难度可以用ajax动态来加载 代码里面的b1是什么意思?初学,见谅... js赋值问题 问高手:JS如何实现像google首页搜索的效果 为什么在select处添加onchange事件无效?? 怎样得到iframe里的表单的值 如何接私活 extjs4 gridpanel 动态tbar JS弹出窗口自适应大小的问题,在线等!!! 关于select的问题,很简单,但是我不会 求助,写成带参数的函数就报错 为什么在绑定匿名的时候,会无法删除呢 谁能给一个事件对列的例子啊
function setPrice(o) {
alert(o.getAttribute('price'))
}
</script>
</head>
<label price="50" onclick="setPrice(this)">套餐1</label> <label price="100" onclick="setPrice(this)">套餐2</label> <label price="150" onclick="setPrice(this)">套餐3</label>
<form action="" method="post" oninput="result.value=parseInt(no1.value)+parseInt(no2.value)">
<input type="number" name="no1" value="" />
<input type="number" name="no2" value="" />
<output name="result"></output>
</form>