Pull txtarea from html editor via select

0

Good afternoon, I'm having trouble correctly displaying the contents of a select within the html ckeditor editor. Code below:

<form>
    <div class="form-group">
    <label for="exampleFormControlSelect1">Selecione a página</label>
    <select class="form-control" id="page" data-placeholder='Nenhum valor selecionado...'>
        @foreach($paginas as $paginas)
      <option value="{{$paginas->conteudo}}">{{$paginas->titulo}}</option>
      @endforeach
    </select>
  </div>
</form>


<button onclick="pegarValores()">Verificar</button>

 <script type="text/javascript">
 function pegarValores(){
    var texto = $('#page').text();
    var valor = $('#page').val();
    var conteudo = document.getElementById("txtArtigo").value = valor;
 }

 </script>

             <textarea id="txtArtigo" name="txtArtigo">
                    <div id="resultado"></div>
            </textarea>
</div>

Before loading the html editor, I click on check and the code works but then it does not work, the idea is that it works even after loading the editor.

    
asked by anonymous 24.09.2018 / 19:36

0 answers