简体   繁体   English

我想点击一个单选按钮

[英]I want to click on a radio button

i am trying to click on Home Radio button, I try many methods that you can see inline // but i didn't get that.我正在尝试单击 Home Radio 按钮,我尝试了许多您可以在线看到的方法 // 但我没有做到。 please tell me where I am doing mistakes.请告诉我我在哪里做错了。

  if (key==="bill-address") {
                    console.log("bill-address")
    
                    //setvalue(Data[key].formname, Data[key].value)
                    //$("[title='"+Data["dba"].formname+"']")[0].click()
                    $("[title='"+Data["bill-address"].formname+"']")[0].click()
                    //$("[title='"+Data[""].formname+"']")[0].click()
                    await wait(2000)
                }

i am trying to click on Home.我正在尝试单击主页。 please see the image请看图片

$("[title='"+Data["bill-address"].formname+"']")[0].checked = true;

Native JS solution:原生JS解决方案:

 document.getElementById("_1234").checked = true;

JQuery solution: jQuery 解决方案:

 $("#_1234").prop("checked", true);

So in your case:所以在你的情况下:

 $("[title|='"+Data["bill-address"].formname+"']")[0].prop("checked", true);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我想制作 4 个单选按钮和 1 个 go 按钮,当我检查任何一个单选按钮然后单击 go 按钮时,我想要更改 url - I want to make 4 radio button and 1 go button, I want when i check any one radio button and then click on go button then the url will be changeded 当我单击jsp中单选按钮的特定选项时,我想显示一个文本框 - I want to display a textbox when I click on a particular option of a radio button in jsp 我想用 Angular 获取单选按钮的值 - I want to get the value of a radio button with Angular 我需要根据选中的单选按钮(由jQuery)执行操作,但是jQuery的click或change方法都不能满足我的要求 - I need to perform an action based on which radio button is selected (by jQuery), but neither jQuery's click or change method is doing what I want 我想当我点击模态上的单选按钮(objectart)时,它应该在另一个 div(objecttype)中更改模态上的其他 div 数据(获取数据库) - i want when i click on radio button (objectart) on modal then it should change other div data (fetch database) on modal in another div(objecttype) 我想强迫某人点击至少一个收音机 - I want to force someone to click atleast one radio 当我选择单选按钮时,将选择所有单选按钮。 我只希望选择一个单选按钮 - when i select radio button then all radio button is selected. i want only one radio button should be selected 如何在单击按钮上使按钮无效? - How do I make a button inactive on radio button click? 弹出点击单选按钮 - Popup a radio button on click 单选按钮(如果单击) - Radio Button if on click
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM