Pick up the value of a radio button

0

Good evening, I'm finding it difficult to work with the radio buttons of my angular form. I need to get the values from my radio buttons, but no solution found here works, neither with jquery nor with pure javascripty. Here is the code:

<mat-radio-group class="posicao" name="G>
  <mat-radio-button class="margem" name="G1" value="1">1</mat-radio-button>
  <mat-radio-button class="margem" name="G2" value="2">2</mat-radio-button>
  <mat-radio-button class="margem" name="G3 value="3">3</mat-radio-button>

    
asked by anonymous 09.11.2018 / 01:47

1 answer

0

You have some quotes open. Also, use all radios of the same name.

<mat-radio-group class="posicao" name="G">
  <mat-radio-button class="margem" name="G" value="1">1</mat-radio-button>
  <mat-radio-button class="margem" name="G" value="2">2</mat-radio-button>
  <mat-radio-button class="margem" name="G" value="3">3</mat-radio-button>
    
09.11.2018 / 01:56