在我们的estore结账时,我们有各种交付选项,对于某个交付选项,我们希望在选中时显示一个弹出框,特定选项复选框如下:
<input id="delivery_option_22_6" class="delivery_option_radio" type="radio" name="delivery_option[22]" data-key="76," data-id_address="22" value="76,">
如果选中此复选框,有人可以告诉我如何创建弹出窗口,这会显示我们选择的消息吗?
谢谢!
答案 0 :(得分:1)
使用onclick
收音机(不需要JQuery)
<input id="delivery_option_22_6" onclick="alert('message')" class="delivery_option_radio" type="radio" name="delivery_option[22]" data-key="76," data-id_address="22" value="76,">
答案 1 :(得分:0)
答案 2 :(得分:0)
这样的事情:
HTML:
<input id="delivery_option_22_6" class="delivery_option_radio" type="radio" name="delivery_option[22]" data-key="76," data-id_address="22" value="76," data-popup="Test message">
<div class="popup" style="display:none"></div>
JavaScript的:
$('input[data-popup]').on('change', function(){
if($(this).is(':checked')) {
// Popup function
$('.popup').text($(this).data('popup')).show();
}
})