javascript - set bootstrap radio as per given value by server -
i'm trying loading data page, server send value browser, example "male". did try
$("#optgender").val("male");
to activated/checked radio button male, doesnt works
<div class="form-group"> <div class="btn-group" data-toggle="buttons"> <label class="btn btn-danger active"> <input type="radio" name="optgender" value="male" checked=""> male </label> <label class="btn btn-danger"> <input type="radio" name="optgender" value="female"> female </label> </div> </div>
$("#optgender").prop('checked',"male");
Comments
Post a Comment