如何隱藏圖像/顯示輸入時勾選複選框,並再次顯示圖像/隱藏輸入複選框時?如何隱藏圖像/顯示輸入時勾選複選框,並顯示圖像/隱藏輸入複選框時再次?
縮略圖:
<div id="thumbnail_image">
<img src="http://www.vetprofessionals.com/catprofessional/images/home-cat.jpg">
</div>
<input type="file" name="offer_image_1" id="offer_image_1" size="30" hidden ">
<br>
<input type="checkbox" id="change_thumbnail_image" name="change_thumbnail_image" value="change_thumbnail_image" class="checkme_ram" /> Change Thumbnail Image
<script type="text/javascript">
document.getElementById('change_thumbnail_image').onchange = function() {
document.getElementById('thumbnail_image').hidden = this.checked;
document.getElementById('offer_image_1').block = this.checked;
};
</script>
非常感謝你^ _ ^ – user3030013