classをdispatch
dispatchの意味を間違えないように。
Javascript(script.aculo.us)で、ブログをアニメーション・デザイン - Goodpicにあったリンク先を見て、そのまま。
function openWindow(){ if (!document.getElementsByTagName) return false; var list = document.getElementsByTagName('a'); for( var i=0; i < list.length; i++ ){ if( list[i].className.match("popup") ){ list[i].onclick = function(){ window.open(this.href); return false; } } } } window.onload = openWindow;
HTML
<a href="http://www.yahoo.co.jp/" class="popup">Yahooへのリンク1</a><br>