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

Popular posts from this blog

How to show in django cms breadcrumbs full path? -

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -