I'm pulling in a results set and traversing a div, matching on A href and trying to add SetAttribute = "_top" because I would like to break out of the frame that this result set is sitting in. The following code seems to work in FireFox, but doesn't appear to be working in IE7. YAHOO.util.Event.onDOMReady( function catlinks(){ var special = YAHOO.util.Dom.getElementsByClassName('special'); for (var i=0 i<special.length;i++){ var anchors = special[i].getElementsByTagName('a'); for (var j=0; j<anchors.length; j++){ anchors[j].setAttribute('target','_top'); } } } ) Code (markup):
Nope, it should work in IE x/7/8. Link targets have been the standard for as long as I can remember. Not sure why it is not working, make sure that you actually retrieve the links (alert/print them).