Reputation: 123
I am trying to set a radiobutton active with the standart jQuery function like in this demo if you do a onclick event.
http://jqueryui.com/button/#radio
I wanna do the same that onclick does but not on click, i wanna do this in a function that is called.
Tried this but it is not working right:
function checkradio() {
$("#labelRADIOVU").button("enable");
$('#RADIOVU').prop('checked', true);
//alert($("input[name='']:checked").val())
document.getElementById("labelRADIOVU").style.color = "white";
document.getElementById("labelRADIOVU").style.backgroundColor = "red";
//document.getElementById("RADIOVU").checked = true;
};
Upvotes: 0
Views: 86
Reputation: 123
You can trigger the click on radio
$('#RADIOVU').trigger('click')
Example: http://jsfiddle.net/nZLeU/
Upvotes: 1