I can set a radio button to checked fine, but what I want to do is setup a sort of 'listener' that activates when a certain radio button is checked.
(我可以将单选按钮设置为选中状态,但是我想做的是设置一种“侦听器”,当选中某个单选按钮时会激活它。)
Take, for example the following code:
(以下面的代码为例:)
$("#element").click(function()
{
$('#radio_button').attr("checked", "checked");
});
it adds a checked attribute and all is well, but how would I go about adding an alert.
(它添加了一个选中的属性,一切都很好,但是我将如何添加警报。)
For example, that pops up when the radio button is checked without the help of the click function? (例如,在没有单击功能的情况下选中单选按钮时,会弹出该窗口吗?)
ask by Keith Donegan translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…