D
D
Dmitry Kuzmishchev2022-01-28 14:11:04
JavaScript
Dmitry Kuzmishchev, 2022-01-28 14:11:04

How to load font by js action?

Hello. Please advise on the implementation. I have a modal window with a different font than the website. How to load font by function popupOpen ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Tkachev, 2022-01-29
@Real_Farmer

Maybe you shouldn't download the font.
It's much easier to change the css
let el_summ = document.querySelector('#summ')
//add a property to the element
el_summ.style.fontFamily="Your font"
el_summ.classList.add('newClass')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question