我正在尝试为用户创建一种选择付款方式(借记卡、信用卡或 PayPal)的方法。根据他们选择的值,我想为付款信息(卡号等)调出一个新菜单。我该怎么做呢?
代码如下:
Payment Method
<select name="Payment" id="Payment">
<option>Debit</option>
<option>Credit</option>
<option>PayPal</option>
</select>
</form>
最佳答案
这是一个 FIDDLE这会让你开始。
JS
$('#payment').change(function(){
var selection = $('#payment').val();
$('.putmehere img').hide();
if( selection == 'd')
{
$('#debit').show();
}
if( selection == 'c')
{
$('#credit').show();
}
if( selection == 'p')
{
$('#paypal').show();
}
});
关于html - 在 CS5 Dreamweaver 中使用列表/菜单表单?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21922981/