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

243
Views
How to change Span text with Javascript?

I am trying to change text using javascript, but I can't target this element no matter what...

<div class="elementor-element elementor-element-2d85236 elementor-widget elementor-widget-text-editor" data-id="2d85236" data-element_type="widget" id="is_connected" data-settings="{&quot;ekit_we_effect_on&quot;:&quot;none&quot;}" data-widget_type="text-editor.default">
            <div class="elementor-widget-container">
                <div class="elementor-text-editor elementor-clearfix"><p style="text-align: center;"><span style="color: #ff0000;">Not Connected</span></p></div>
            </div>
            </div>

I want to change this "Not Connected" to "Connected" I tried with this, but it doesn't work:

var AddressText = $("#connect").html(address.substr(0, 13) + "...")
    var elems = document.getElementsByClassName(elementor-element elementor-element-2d85236 elementor-widget elementor-widget-text-editor)[0].innerText;
    elems = "Connected"
about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

Wrap the selector inside '

document.getElementsByClassName('elementor-element elementor-element-2d85236 elementor-widget elementor-widget-text-editor')[0].innerText = 'connected'
about 4 years ago · Juan Pablo Isaza Report

0

let spanTag = document.querySelector('.elementor-clearfix p').childNodes[1];
spanTag.innerHTML = 'Connetcted';
<div class="elementor-element elementor-element-2d85236 elementor-widget elementor-widget-text-editor" data-id="2d85236" data-element_type="widget" id="is_connected" data-settings="{&quot;ekit_we_effect_on&quot;:&quot;none&quot;}" data-widget_type="text-editor.default">
  <div class="elementor-widget-container">
    <div class="elementor-text-editor elementor-clearfix">
      <p style="text-align: center;">
        <span style="color: #ff0000;">Not Connected</span>
      </p>
    </div>
  </div>
</div>

let spanTag = document.querySelector('.elementor-text-editor elementor-clearfix')[1];
spanTag.innerHTML = 'connected';

about 4 years ago · Juan Pablo Isaza Report

0

Here is the code you can try :

   var elems = "Connected"
   var AddressText = document.getElementsByClassName('elementor-element elementor-element-2d85236 elementor-widget elementor-widget-text-editor')[0].innerText = elems
about 4 years ago · Juan Pablo Isaza 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!