Since you are not able to edit the markup directly, use a javascript to change the onClick attribute. You may have to do this in onLoad()
. But here, i have done this with the help of a button. When the button is clicked a JavaScript function, setClick()
is called which changes the onClick
attribute to the required url. After that you can just click the link and this generates a popup at the center of the screen.
The center of the screen is calculated using Javascript.
What i have done to get the link, is using document.getElementsByTagName("a")[0]
, which gets the first <a>
tag. Similrly you can search for the <a>
in your code too and follow the same procedure..
Try this..
HTML
<a onclick="javascript:window.open('https://www.thelink.org/faf/login/loginParticipantPopUp.asp?ievent=1138380','loginwin','menubar=no,scrollbars=yes,resizable=yes,width=400,height=200')" href="#">click here</a>
<input type="button" value="Change URL" onclick="setClick();">
JavaScript
function changeURL() {
var left = (screen.width / 2) - (400 / 2);
var top = (screen.height / 2) - (200 / 2);
var url = "javascript:window.open('https://www.thelink.org/faf/login/loginParticipantPopUp.asp?ievent=1138380','loginwin','menubar=no,scrollbars=yes,resizable=yes,width=400,height=200, top=" + top + ", left=" + left + "')";
return url;
}
function setClick() {
document.getElementsByTagName("a")[0].setAttribute("onClick", changeURL());
}