【发布时间】:2014-01-24 01:15:59
【问题描述】:
我在 stackoverflow 上看到了很多不同的方法。但是,我已经尝试过它们,但无法使其正常工作。
这是我当前的代码。
http://jsfiddle.net/tech0925/C9Z8N/5/
这里是javascript
function printcardCheck() {
if (document.getElementById('print_card').checked) {
document.getElementById('printvoucher-receiver').style.display = 'block';
document.getElementById('printvoucher-receiver').style.padding = '10px 0 0 0';
document.getElementById('print_cards').value = 'Add this value';
}
else document.getElementById('printvoucher-receiver').style.display = 'none';
}
请参阅上面的小提琴链接。
【问题讨论】:
-
您的预期结果是什么?我的意思是,没有 id 为
giftvoucher-receiver的元素,你甚至还没有定义mailcardCheck()。 -
嗨,很抱歉。那是我没有带来的其他代码。我更新了我的代码和小提琴。
标签: javascript html html-input