You have the "starts with" selector ^=
$( "a[href^='mypage.php']" ).on( "click", function(){
//do smething
} );
edit
Oh, i got your point. This is what you need.
$( "a[href^='mypage.php']" ).trigger( "click" );
edit2
i've figured out that you may have no jQuery in page. So, here is a fiddle with the propper solution: https://jsfiddle.net/shhzncw1/1/
And here is your script:
(function(){
var el = document.querySelector('a[href^="mypage.php"]');
var evt;
if (document.createEvent) {
evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
}
(evt) ? el.dispatchEvent(evt) : (el.click && el.click());
})();
edit 3
But if your intent is just to go to the page, you could just do a redirect. Think about it. (:
(function(){
var el = document.querySelector('a[href^="mypage.php"]');
var href = el.href;
window.location.href = href;
})();