Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.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_Jquery_Onclick_Automation_Click - Fatal编程技术网

页面上的Javascript生成按钮,每秒自动单击另一个按钮

页面上的Javascript生成按钮,每秒自动单击另一个按钮,javascript,jquery,onclick,automation,click,Javascript,Jquery,Onclick,Automation,Click,我想发出一个警报,它将每秒单击另一个没有脚本生成的按钮。到目前为止我有 var input=document.createElement("input"); input.type="button"; input.value="Click To Activate"; input.onclick = showAlert; input.setAttribute("style", "font-size: 17px;position: fixed;top: 225px;right:40px:"); doc

我想发出一个警报,它将每秒单击另一个没有脚本生成的按钮。到目前为止我有

var input=document.createElement("input");
input.type="button";
input.value="Click To Activate";
input.onclick = showAlert;
input.setAttribute("style", "font-size: 17px;position: fixed;top: 225px;right:40px:");
document.body.appendChild(input); 

function showAlert()
{
    alert("Active");
}
现在我想点击按钮,上面有代码

<span class="b-link js-profile-header-vote" data-choice="yes"></span>

每秒钟。

$(文档).ready(函数(){
var输入=document.createElement(“输入”);
input.type=“按钮”;
input.value=“点击激活”;
input.onclick=showart;
setAttribute(“样式”,“字体大小:17px;”);
document.body.appendChild(输入);
函数showAlert()
{
setInterval(函数(){$(“#js_profile_header_vote_1”)。单击();},1000);
}
$(“#js#u profile_header_vote_1”)。单击(函数(){
警报(“点击js_配置文件_标题_投票_1按钮”);
});
});

我是个傻瓜,不知道怎么做