Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

399
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!