appendTo($wrapper) {
      const buttons = [];
      const self = this;

      const toggleSelected = $selectedInput => {
        buttons.forEach($button => {
          $button.removeClass('checked');
        });

        $selectedInput.parent().addClass('checked');
      };

      self.$container = $(H5PEditor.createFieldMarkup(
        self.field,
        `<div class="h5p-editor-image-radio-group-container ${self.alignment}" role="radiogroup"></div>`
      ));

      const $buttonGroup = self.$container.find('.h5p-editor-image-radio-group-container');

      for (let i = 0; i < self.field.options.length; i++) {
        const option = self.field.options[i];
        const inputId = `h5p-editor-image-radio-group-button-${groupCounter}-${i}`;
        const isChecked = (self.value === option.value) ||
          (self.value === undefined && this.field.default === option.value);

        const $label = $('<label>', {
          class: `h5p-editor-image-radio-group-button ${option.value}${isChecked ? ' checked' : ''}`
        }).appendTo($buttonGroup);
        buttons.push($label);

        const $icon = $('<span>', {
          class: 'font-icon',
          style: `font-family: "${self.fontFamily}"`,
          html: option.fontIcon ? `&#x${option.fontIcon};` : ""
        });
        $icon.appendTo($label);


        const $input = $('<input>', {
          type: 'radio',
          name: self.field.name + groupCounter,
          value: option.value,
          id: inputId,
          'aria-hidden': 'true',
          checked: isChecked,
          change: () => {
            toggleSelected($($input));
            self.value = $('input:checked', $buttonGroup).val();
            self.setValue(self.field, self.value);
            self.triggerListeners();
          }
        }).appendTo($label);

        $('<span>', {
          html: option.label,
        }).appendTo($label);

        if (option.description) {
          $('<div>', {
            class: 'h5p-option-description',
            html: option.description
          }).appendTo($label);
        }
      }

      self.$container.appendTo($wrapper);
    }
/**
       * Append the field to the wrapper.
       * @public
       * @param {H5P.jQuery} $wrapper
       */
Append the field to the wrapper.
Append the field to the wrapper .
appendTo($wrapper) {
      const buttons = [];
      const self = this;
      const toggleSelected = $selectedInput => {
        buttons.forEach($button => {
          $button.removeClass('checked');
        });
        $selectedInput.parent().addClass('checked');
      };
      self.$container = $(H5PEditor.createFieldMarkup(
        self.field,
        `<div class="h5p-editor-image-radio-group-container ${self.alignment}" role="radiogroup"></div>`
      ));
      const $buttonGroup = self.$container.find('.h5p-editor-image-radio-group-container');
      for (let i = 0; i < self.field.options.length; i++) {
        const option = self.field.options[i];
        const inputId = `h5p-editor-image-radio-group-button-${groupCounter}-${i}`;
        const isChecked = (self.value === option.value) ||
          (self.value === undefined && this.field.default === option.value);
        const $label = $('<label>', {
          class: `h5p-editor-image-radio-group-button ${option.value}${isChecked ? ' checked' : ''}`
        }).appendTo($buttonGroup);
        buttons.push($label);
        const $icon = $('<span>', {
          class: 'font-icon',
          style: `font-family: "${self.fontFamily}"`,
          html: option.fontIcon ? `&#x${option.fontIcon};` : ""
        });
        $icon.appendTo($label);
        const $input = $('<input>', {
          type: 'radio',
          name: self.field.name + groupCounter,
          value: option.value,
          id: inputId,
          'aria-hidden': 'true',
          checked: isChecked,
          change: () => {
            toggleSelected($($input));
            self.value = $('input:checked', $buttonGroup).val();
            self.setValue(self.field, self.value);
            self.triggerListeners();
          }
        }).appendTo($label);
        $('<span>', {
          html: option.label,
        }).appendTo($label);
        if (option.description) {
          $('<div>', {
            class: 'h5p-option-description',
            html: option.description
          }).appendTo($label);
        }
      }
      self.$container.appendTo($wrapper);
    }
appendTo ( $wrapper ) { const buttons = [ ] ; const self = this ; const toggleSelected = $selectedInput => { buttons . forEach ( $button => { $button . removeClass ( 'checked' ) ; } ) ; $selectedInput . parent ( ) . addClass ( 'checked' ) ; } ; self . $container = $ ( H5PEditor . createFieldMarkup ( self . field , ` ${ self . alignment } ` ) ) ; const $buttonGroup = self . $container . find ( '.h5p-editor-image-radio-group-container' ) ; for ( let i = 0 ; i < self . field . options . length ; i ++ ) { const option = self . field . options [ i ] ; const inputId = ` ${ groupCounter } ${ i } ` ; const isChecked = ( self . value === option . value ) || ( self . value === undefined && this . field . default === option . value ) ; const $label = $ ( '<label>' , { class : ` ${ option . value } ${ isChecked ? ' checked' : '' } ` } ) . appendTo ( $buttonGroup ) ; buttons . push ( $label ) ; const $icon = $ ( '<span>' , { class : 'font-icon' , style : ` ${ self . fontFamily } ` , html : option . fontIcon ? ` ${ option . fontIcon } ` : "" } ) ; $icon . appendTo ( $label ) ; const $input = $ ( '<input>' , { type : 'radio' , name : self . field . name + groupCounter , value : option . value , id : inputId , 'aria-hidden' : 'true' , checked : isChecked , change : ( ) => { toggleSelected ( $ ( $input ) ) ; self . value = $ ( 'input:checked' , $buttonGroup ) . val ( ) ; self . setValue ( self . field , self . value ) ; self . triggerListeners ( ) ; } } ) . appendTo ( $label ) ; $ ( '<span>' , { html : option . label , } ) . appendTo ( $label ) ; if ( option . description ) { $ ( '<div>' , { class : 'h5p-option-description' , html : option . description } ) . appendTo ( $label ) ; } } self . $container . appendTo ( $wrapper ) ; }
Append the field to the wrapper.
Append the field to the wrapper .