change text displayed on selected radio button

0

I have a function to show value and index of the selected input in a list type: radio

<script type="text/javascript">
        $(function() {
            var $radBtn = $("span.ef-example-3-rating input:radio");
            $radBtn.click(function() {
                var $radChecked = $(':radio:checked');
                $("#para").text('')
                    .append("<b>Index: </b>" +
                        $radChecked.val() + "<br/>")
                    .append("<b>Value: </b>" +
                        $radChecked.next().text());
            });
        });
    </script>

the input is like that

<input type="radio" class="ef-example-3-rating-input" id="ef-example-3-rating-input-3-1" name="ef-example-3-rating-input-1" value="hola">

and the text shown is as follows

  

Index: hello

     

Value:

I would like only the text to appear only. Headers do not, neither Value nor Index. Maybe also to want it that way, should not the text be in the Value tag: and in Index: a number?

Thanks

    
asked by Hernan527 09.08.2018 в 12:48
source

0 answers