Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

102
Visualizações
Why can't I change ```font-feature-settings``` directly with javascript?

I want to make a simple web page to test OpenType features.

What I want: I simply enter some text and the feature I want to use in inputboxes, and click a button to change the content and style of a div.

However I found that the font-feature-settings wouldn't change as I expect. For example,

<html>

<body>
  <input id="feature" /><input type="button" value="Change Feature" onclick="
    alert(document.getElementById('feature').value);
    document.getElementById('display').style.fontFeatureSettings=document.getElementById('feature').value;
    alert(document.getElementById('display').style.fontFeatureSettings);" />
  <div id="display" style="font-size:72;">Some text</div>
</body>

</html>

In my Chrome, the first message box shows what I inputed, yet the second message box is always empty.

I end up defining a lot of CSS classes and changing them with javascript. It works now, but it doesn't meet my need, for I have to predefine a lot of features and thus have difficulty in extending it for future use.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda