I want to author an anchor tag that executes some JavaScript and then proceeds to go wherever the href
was taking it. Invoking a function that executes my JavaS
When doing a clean HTML Structure, you can use this.
//Jquery Code
$('a#link_1').click(function(e){
e . preventDefault () ;
var a = e . target ;
window . open ( '_top' , a . getAttribute ('href') ) ;
});
//Normal Code
element = document . getElementById ( 'link_1' ) ;
element . onClick = function (e) {
e . preventDefault () ;
window . open ( '_top' , element . getAttribute ('href') ) ;
} ;
Do it!