更多更改()函数jQuery没有'不起作用
More change() function jQuery doesn't work?
这怎么不起作用?这只适用于表的第一行。第二排不起作用。谢谢你的建议。**
<table id="ticketTable">
<tr><td>
<select id="ticketSelect1">
<option priceValue1="120" value="1" selected>Adult</option>
<option priceValue1="110" value="2">Student</option>
</select>
</td>
<td style="text-align:right"><span id="price1">120</span></td>
</tr>
<tr><th>Typ lístku</th><th style="text-align:right">Cena</th></tr>
<tr><td><select id="ticketSelect2">
<option priceValue2="120" value="1" selected>Adult</option>
<option priceValue2="110" value="2">Student</option>
</select></td><td style="text-align:right"><span id="price2">120</span></td></tr>
</table>
<script type="text/javascript">
$(document).ready(function(){
$("table tr td #ticketSelect1").change(function() {
$('#price1').text($('option:selected').attr('priceValue1'));
}).change();
$("table tr td #ticketSelect2").change(function() {
$('#price2').text($('option:selected').attr('priceValue2'));
}).change();
});
</script>
**
试试这些选择器:
$('#price1').text($('#ticketSelect1 option:selected').attr('priceValue1'));
和
$('#price2').text($('#ticketSelect2 option:selected').attr('priceValue2'));
相关文章:
- 我的AngularJS表达式没有'不起作用
- jpm的默认Firefox路径没有'不起作用
- pageMod没有'似乎不起作用
- jQuery.remove(Selector)没有'不起作用
- Phonegap 3.7.0手电筒插件没有'不起作用
- Javascript,如果条件在没有&&逻辑运算符当&&它不起作用
- javascript选项卡没有'不起作用
- JQuery示例不起作用-“;对象没有't支持属性或方法'按钮'&”;
- I'我试图在文本区域中进行特定的输入,调用特定的javascript函数,但没有成功;不起作用
- 手机摄像头没有'不起作用
- AngularJS没有'不起作用
- I'我不知道为什么我的代码没有'不起作用
- -webkit转换在JavaScript旋转动画中不起作用(没有JQuery)
- 角度 UI 类型提前不起作用 - 没有错误
- Jquery 谷歌自动完成不起作用 - 没有错误
- 在iframe中编写一些html和js,在IE中不起作用:没有定义$
- Peerjs不起作用.没有错误
- Twitter Bootstrap的下拉菜单不起作用——没有展开
- jQuery在任何浏览器中都不起作用(没有任何效果),但它在Codepen中工作
- 文档就绪不起作用.没有控制台错误,并且包括jQuery