Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/373.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我如何用Javascript创建一个自动点击网站按钮的代码_Javascript_Html - Fatal编程技术网

我如何用Javascript创建一个自动点击网站按钮的代码

我如何用Javascript创建一个自动点击网站按钮的代码,javascript,html,Javascript,Html,如何使用Javascript创建一个代码,该代码可以自动单击按钮,并在web站点上同时写入texbutton和checkbutton。如果我这样做,对我会很有帮助 <html> <head> </head> <body> <a href="index.html" class="wp_textBox">Giris</a> </body> <script src=" My_Link_ "></scr

如何使用Javascript创建一个代码,该代码可以自动单击按钮,并在web站点上同时写入texbutton和checkbutton。如果我这样做,对我会很有帮助

<html>
<head>
</head>
<body>
<a href="index.html" class="wp_textBox">Giris</a>
</body>
<script src=" My_Link_ "></script> 
<script type="text/javascript">
 window.onload = function() {
  window.location.href = ('.wp_textBox').attr('href');
});
}
</script>

</html>

window.onload=函数(){
window.location.href=('.wp_textBox').attr('href');
});
}
事实上,我无法创建代码,它无法工作。去了解我到底想要什么

在网站上,我们有文本按钮,选择按钮,复选框和搜索按钮一起,在第一个我们可以使用相同代码的文本框(我们可以在第一个文本按钮中输入相同的文本)。够了。但是我需要在这个文本按钮中写一些东西来搜索。之后,对于这个搜索,我需要单击chechbuttun(A5)进行分类。我最不想要的是单击搜索按钮(文本按钮已写入,选择按钮已单击,复选框已单击)

我该怎么做?我需要清楚地走哪条路?是否有一个有java脚本的示例应用程序

空屏幕


我想这样做,我喜欢这样的图片自动

将id属性添加到锚点

 <a href="index.html" class="wp_textBox" id="girls">Giris</a>
编辑

要从js中填充文本字段,只需在文本字段中添加带有
txtAuthDocNumber
name的ID属性,并在下面编写代码

document.getElementsById("txtAuthDocNumber").innerHTML="00VF832A";
对于选择选项

document.getElementById('txtAuthDocNumberSelect').value="00VF832A";
用于复选框

document.getElementById("check_box_id").checked = true
点击按钮

 document.getElementById('button_id').click();

当我分享输入屏幕的图片时,在修改我的代码后,你的评论仍然是empyt。我想在这个“文本按钮”中写一些文本,我想为点击搜索按钮自动编写代码。怎么可能呢?
 document.getElementById('button_id').click();