<script language="javascript">
function test2(name)
{
if(document.all)
{
document.getElementById(name).click();
}
else
{
var evt = document.createEvent("MouseEvents");
evt.initEvent("click", true, true);
document.getElementById(name).dispatchEvent(evt);
}
}
</script>
<a href="#" id="a3" onclick="location.href = 'http://www.baidu.com';">baidu</a>
<input type="button" value="clck" onclick="test2('a3');"/>
转载:[url]http://justcoding.iteye.com/blog/688467[/url]