I need to open a popup window centered on screen. The approach in this article works well, however I can not have an onclick attribute on the link/button.
I created this JS Fiddle, can anyone please help me combine the two?
// find elements
var button = $("button")
// handle click
button.on("click", function(){
var left = ($(window).width()/2)-(500/2),
top = ($(window).height()/2)-(700/2),
popup = window.open ("https://apple.com", "popup", "width=500, height=700, top="+top+", left="+left);
})