link(){ var olink = getElementById("link"); var text = olink.innerHTML; var start = text.indexOf(">")+1; var end = text.lastIndexOf("<"); text = text.substring(start,end); location.href=text; } <a href="java:void(0)" ="link()">maito:smvcn@yahoo.com.cn</a>