A
A
Anastasia2022-03-10 15:20:24
JavaScript
Anastasia, 2022-03-10 15:20:24

How to get line width in px?

There is a select, the width of which will depend on the width of the word that is selected from its drop-down list, select as a date receives an array of objects, of the form

const options = [
  { value: 'Воронеж', label: 'Воронеж' },
  { value: 'Липецк', label: 'Липецк' },
  { value: 'Москва', label: 'Москва' },
];

how to get word width when selecting?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Goretsky, 2022-03-10
@KnopkaNen

Through getComputedStyle , you get all the calculated properties of the element and pull out the one you need. There are examples there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question