Click the button to find out if the a element has a "target" attribute. If so, change the value of the target attribute to "_self_" instead of "_blank".
Try clicking on the link before and after you have clicked the button.
Note: Internet Explorer 8 and earlier does not support the hasAttribute() and setAttribute() methods.