About the separation of onclick behavior and content
1. Trigger pop-up windows through links (this method is not recommended!!!)
<a href='#' onclcik = "window.open('holiday_pay.html',WinName,'width=300, height = 300');"> Holiday Pay </a>
If JS is disabled and the link cannot guide the user to the corresponding page, do not assign "#" and similar values to the href attribute
2. Ordinary situations
<a href='holiday_pay.html' onclcik = "window.open(this.href,WinName,'width=300, height = 300');"> Holiday Pay </a>
3.0 A large number of repeated links, assign an identifiable class name to each link, and add listeners for each click event using jQuery Device
<a href="holiday_pay" class="popup">Holiday pay</a> var links = $("a.popup"); links.clcik(function(event){ event.preventDefault(); window.open($(this).attr('href')); });
3.1 Set the pop-up window size through multiple custom data types
<a href ="holiday_pay.html" data-width="600" data-heigth = "400" title = "Holiday Pay" class = "popup"> Holiday pay </a>
$(function(){ $(".popup").click(function(event){ event.preventDefault(); var href=$(this).attr("href"); var width = $(this).attr("data-width"); var height = $(this).attr("data-height"); var popup = window.open(href,"popup","height="+height+",width="+width+""); }) ; });
The above summary (recommendation) of HTML5 and CSS3 example tutorials is all the content shared by the editor. I hope it can be useful to everyone. A reference. For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com)!