img tag added click event does not take effect problem solved

 <!--图标-->
<div class="col-sm-2 paymentMode-data-materialUrl1">
   <input id="materialId1" name="materialId1" type="hidden"/>
   <input id="materialUrl1" name="materialUrl1" style="width: 156px;height: 78px;" type="image" onclick="openImageLib(1);"/>
</div>

A click event is added to the picture. This event is a pop-up box to select the uploaded picture, but after adding the function, the pop-up box flashes and the picture cannot be selected. The solution—
在函数后加一个return false;即可

 <!--图标-->
<div class="col-sm-2 paymentMode-data-materialUrl1">
   <input id="materialId1" name="materialId1" type="hidden"/>
   <input id="materialUrl1" name="materialUrl1" style="width: 156px;height: 78px;" type="image" onclick="openImageLib(1);return false;"/>
</div>

Guess you like

Origin blog.csdn.net/yzx3105/article/details/106728740