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

163
Views
How to add css langage style with javascrit for lang(en)::before / lang(fr)::before

Is there a way to do this css code with javascript langage or jquery and have the same result? I don't find any sample for this.

#readonlyEmail_label:lang(fr)::before{
    content: 'Adresse courriel vérifiée. Vous pouvez continuer.';
    font-family: 'Open Sans', sans-serif;
    font-weight: bold;
    font-size: 14px;
    width:650px;
    padding-bottom: 24px;
    display: block;
}
#readonlyEmail_label:lang(en)::before{
    content: 'Email address verified. You can now continue.';
    font-family: 'Open Sans', sans-serif;
    font-weight: bold;
    font-size: 14px;
    width:650px;
    padding-bottom: 24px;
    display: block;
}

Thanks

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

0

This can be done by editing the document stylesheet from JavaScript, like so:

const lang = {
  fr: {
    text: `content: 'Adresse courriel vérifiée. Vous pouvez continuer.'`,
    color: `color: #F00`
  },
  en: {
    text: `content: 'Email address verified. You can now continue.'`,
    color: `color: #0F0`
  }
};

const css = document.styleSheets[0];

css.addRule('.readonlyEmail_label:lang(fr)::before', lang.fr.text);
css.addRule('.readonlyEmail_label:lang(fr)::before', lang.fr.color);
css.addRule('.readonlyEmail_label:lang(en)::before', lang.en.text);
css.addRule('.readonlyEmail_label:lang(en)::before', lang.en.color);
.readonlyEmail_label:lang(fr)::before {}
.readonlyEmail_label:lang(en)::before {}
<div class="readonlyEmail_label" lang="en"><q>This English quote has a <q>nested</q> quote inside.</q></div>
<div class="readonlyEmail_label" lang="fr"><q>This French quote has a <q>nested</q> quote inside.</q></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!