如何使用javascript自动点击此表单

时间:2012-08-26 00:02:50

标签: javascript click

javascript代码可以实现自我点击这个表单吗?

  <head><script language=JavaScript1.2></script>
    </head>
    <body>
    <form action="http://www.tumblr.com/follow" id="FormType"  method="post" style="display:block; float:left;" onsubmit="_gaq.push(['_trackEvent', 'Iframe', 'Follow', 'c-h-o-c-o-l-a-t-a');">

                            <input type="hidden" name="form_key" value="QT4EOzpHQoAwecU3oWHu0uThVY">
                            <input type="hidden" name="id" value="c-h-o-c-o-l-a-t-a">
                            <input type="image" src="http://assets.tumblr.com/images/iframe_follow_alpha.png?1037" style="width:58px; height:20px; border-width:0px; display:block; margin-left:3px; cursor:pointer;" alt="Follow" name="image" id="followbb">

                        </form>
</body>

1 个答案:

答案 0 :(得分:0)

将此脚本放在<head>

<script type="text/javascript">
  function autoClick () {
    document.forms["FormType"].submit();
   }
 window.onload = autoClick;
</script> 

当文件完成加载时,表格将被提交(魔术!)。