在JavaScript中为使用Browser.execute的方法使用参数
这段代码有效。我想参数化传递给在JavaScript中为使用Browser.execute的方法使用参数,javascript,Javascript,这段代码有效。我想参数化传递给el.innText的值 selectTemplateCheckBox(){ const checkbox=this.templateCheckBox; const temp=模板名; browser.execute((选择器)=>{ selector.find(el=>el.innerText===“AG-1743RAJ”).previousElementSibling.querySelector('input')。单击(); },复选框); } 如何参数化传递
el.innText
的值
selectTemplateCheckBox(){
const checkbox=this.templateCheckBox;
const temp=模板名;
browser.execute((选择器)=>{
selector.find(el=>el.innerText===“AG-1743RAJ”).previousElementSibling.querySelector('input')。单击();
},复选框);
}
如何参数化传递AG1743RAJ的任何值的方法
selectTemplateCheckBox(值){
const checkbox=this.templateCheckBox;
const temp=模板名;
browser.execute((选择器)=>{
selector.find(el=>el.innerText==value).previousElementSibling.querySelector('input')。单击();
},复选框);
}
这起作用了
selectTemplateCheckBox(templateName) {
const checkbox = this.templateCheckBox;
const temp = templateName;
browser.execute((selector, temp) => {
selector.find(el => el.innerText === `${temp}`).previousElementSibling.querySelector('input').click();
}, checkbox, temp);
}
这起作用了
selectTemplateCheckBox(templateName) {
const checkbox = this.templateCheckBox;
const temp = templateName;
browser.execute((selector, temp) => {
selector.find(el => el.innerText === `${temp}`).previousElementSibling.querySelector('input').click();
}, checkbox, temp);
}