现有网页main.html和子网页test.html
main中仅有<frameset rows="*" border="0" framespacing="0" frameborder="NO">
<frame src="test.html">
<noframes>
现在需要在main中修改test.html的onmousedown事件
但如下代码未能获得效果
var frames=document.getElementsByTagName('frame');
function testfunction(){
alert('test');
}
frames[0].document.onmousedown=testfunction;
求教如何修改