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

132
Views
Cómo obtener todo el estilo del elemento.

Tengo un estilo como este:

 .filter { background-image: url("../images/index.png"); !important; background-blend-mode: difference !important; filter: invert(1); box-shadow: inset 0 0 0 1px black; **other style** }

y quiero obtener todo el estilo posible?

si quiero obtener con nombre de propiedad como

 $(selector).css(property-name:property-value);

Debería escribir muchos códigos de línea porque el estilo es muy variado.

  • No puedo usar el estilo en línea y obtenerlo con attr
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

No puede obtener las propiedades de una sola clase CSS, pero puede obtener todo el estilo calculado de un elemento:

 var e = getElementById('myElement'); console.log( getComputedStyle(e) );
about 4 years ago · Juan Pablo Isaza Report

0

Puedes usar getComputerStyle

 const h3 = document.querySelector("h3"); const result = document.getComputedStyle(h3).content();

Documentos GetComputedStyle

También puedes usar el método getAttribute con style

 conat h3 = document.querySelector("h3"); let styles = h3.getAttribute("style"); styles.replace(" ", "") .split(";") .map(s => s.split(":"));
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!