Answer the question
In order to leave comments, you need to log in
Why can't I change the height inline style using JS in Yandex maps?
Why can't I change the height inline style using JS in Yandex maps?
let ymaps = document.querySelector('#ymaps111111111111')
ymaps.style.height = '200px'
Answer the question
In order to leave comments, you need to log in
Most likely, you are trying to perform this operation before this element even appears in the DOM. If Yandex maps are added via html, just wrap
window.onload = function() {
// Ваш скрипт
};
$(elem).on("DOMNodeInserted", function (event) { /* ваш код */ });
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question