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

190
Views
Styling a div based on the flex wrap property using javaScript

A created a function that renders buttons depending on how many data gotten from database.

I want to use js to set the style the button container differently,

especially setting property of of the button container to flex direction to column when it starts wrapping,

Since the website can have many buttons.

Is there a way to use javascript to check for the flexwrap property of the button container.

I tried this code but it is returning an empty string Console.log (btnContainer.style.flexWrap)

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

0

try running btnContainer.style in the console directly, rather than console.log(). hope it will help you find a solution

about 4 years ago · Juan Pablo Isaza Report

0

This commend check only inline style like <div style="flex-wrap:wrap;"></div>. Now if you console.log(document.querySelector('div').style.flexWrap) you will get string with value "wrap".

The solution your problem is add style this element in html inline as I wrote above or in js like document.querySelector('div').style.flexWrap = wrap

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!