I want get value from radio button that made by bootstrap with jquery

I try with this but not work

    $('#search-type input').on('change', function() {
   alert($('input[name=\'options\']:checked', '#search-type').val());
        <div class="btn-group btn-group-toggle" data-toggle="buttons" id="search-type">
            <label for="Search">Search for:&nbsp;</label>
          <label class="btn btn-secondary active">
            <input type="radio" name="options" id="option1" autocomplete="off" value="Photo" checked> Photo
          <label class="btn btn-secondary">
            <input type="radio" name="options" id="option2" autocomplete="off" value="Video"> Video

1 Answers

Sumithran On

Try this,

<script type="text/javascript">



            var radioValue = $("input[name='options']:checked").val();


                alert("Your are a - " + radioValue);




Hope helpful.