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

335
Views
How to center this div's content, which is created when a button is clicked and is inside a flex div?

When the form is submitted, the page content gets replaced and a Thank you msg shows up. It now goes in a <div>, but set to its left.

Here's the resulting html part:

<div class="row">
  <div style="color:#373737;text-align:center">
    <h5>Thank you!</h5>
    <p>
       We will be processing your response!
    </p>
  </div>
</div>

This is the javascript piece:

function saveData() {
  var searchForm = document.getElementById('search-form')
  var page = document.getElementById("page");
  var table = document.getElementById("dtable");

  page.innerHTML = "";
  table.innerHTML = "";
  searchForm.closest("div.row").innerHTML = "<div style='color:#373737;text-align:center'><h5>Thank you!</h5>" + 
"<p>We will be processing your response!</p>"+
"</div"
}

Thank you for your help!

Here is an attempt: enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try this:

searchForm.closest("div.row").innerHTML = "<div style='color:#373737;text-align:center;display:flex;justify-content:center;align-items:center;flex-direction:column'><h5>Thank you!</h5>" + 
"<p>We will be processing your response!</p>"+
"</div"
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!