Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

400
Visualizações
TinyMCE getContent Returns Null

I'm trying to get the raw HTML out of TinyMCE editor. Here is the code I am using

      tinymce.init({
          selector: 'textarea',
          plugins: 'a11ychecker advcode casechange export formatpainter image editimage linkchecker autolink lists checklist media mediaembed pageembed permanentpen powerpaste table advtable tableofcontents tinycomments tinymcespellchecker',
          toolbar: 'a11ycheck addcomment showcomments casechange checklist code export formatpainter image editimage pageembed permanentpen table tableofcontents',
          toolbar_mode: 'floating',
          tinycomments_mode: 'embedded',
          tinycomments_author: 'Author name',

         
        });

        console.log (tinymce.get('content-text'))


In the console it says null. I have also used the active editor function.

console.log (tinymce.activeEditor.getContent())

Doing this gives me an error

Uncaught TypeError: Cannot read properties of null (reading 'getContent')
    at contact-us.html:62:43

I'm using TinyMCE version 6.1

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Place the <script> to below the <textarea> and try again.

Or try to add ID onto textarea tag like

<textarea id="tinyarea">
...
</textarea>

and change selector in the js to

selector: 'textarea#tinyarea',
about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda