简体   繁体   中英

How I can print the image when click the image link?

 <div class="grid col-220 cert">
   <a href="images/1.jpg" class="certTop" rel="prettyPhoto[certificates]"><img src="images/thumb/" /></a>
   <a href="images/1.jpg" class="certBottom" ><i class="fa fa-print"></i>Certificate Name </a>
</div>

I want to print 1.jpg when click to the class ".certBottom". How I can do it with?

Use this jQuery code:

$(document).ready(function() {
   $(".certTop").click(function () {
      $(this).append('<img src="images/1.jpg">');
   });
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM