I need to force a click within a hta script

断了今生、忘了曾经 提交于 2019-12-14 04:14:43

问题


I'm a good scripter, but not a developer. Can someone please advise how to force a click event to this line of code, or to force the "installergui_startinstallation" routine to kick off automatically. Thanks. Here is the line that takes the click command:

<button id=butStartInstallation onClick="InstallerGUI_startInstallation">Install</button>&nbsp;&nbsp;&nbsp;&nbsp;
<button id=butCancel            onClick="self.close()">Cancel</button>

回答1:


So I am a Javascript man, and it looks like in HTA you can have a <script type="text/javascript"> so if that is the case then have a shot at this

<button id="butStartInstallation" onClick="InstallerGUI_startInstallation">Install</button>
<button id="butCancel" onClick="self.close()">Cancel</button>

<script type="text/javascript">
    function doClick() {
        document.getElementById("butStartInstallation").click();
    }
    doClick();
</script>



If that isn't enough HERE is another resource for you to check out. They use Javascript in that example

If you are using VBScript then HERE is another example for you to check out



来源:https://stackoverflow.com/questions/40030955/i-need-to-force-a-click-within-a-hta-script

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!