页面上的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按钮”);
});
});代码>
我是个傻瓜,不知道怎么做