[英]How to hide a div/image on page load where it is looped in php array and with different id
I am listing some products from database, there is a div to reduce the product quantity from cart and its id is attached with the html id attribute. 我正在从数据库中列出一些产品,这里有一个div来减少购物车中的产品数量,并且其id附加有html id属性。 I want to hide this div on page load. 我想在页面加载时隐藏此div。 What is best solution for it 什么是最佳解决方案
<img src="images/add-minus.png" class="minus-image" onClick="removeitem('<?php echo $row12['itemid'];?>')" id="minus-image<?php echo $row12['itemid'];?>">
I need to hide this div on page load 我需要在页面加载时隐藏此div
Add style="display:none"
; 添加style="display:none"
;
For example how to using it and how to display if you need it. 例如,如何使用它以及如何显示(如果需要)。
$(document).on("click", "#view", function(){ $('#test').show(); });
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <p id="test" style="display:none">Lorem Ipsum</p> <button id='view' class='pull-left' title='Save'>Show Content</button>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.