在ie客户端模拟键盘输入!

来源:岁月联盟 编辑:zhuzhu 时间:2003-07-11
<html>
<body>
<table>
<tr><td onclick="selecttoolid('find')">尋找</td></tr>
</table>
</body>
</html>
<script language="javascript">
function selecttoolid(id){
var WshShell = new ActiveXObject("Wscript.Shell");
    switch(id){
        case 'find':
            try{WshShell.SendKeys("^f");} catch(e){}  
            break    
        }
WshShell.Quit;
}
</script>