Answer the question
In order to leave comments, you need to log in
JavaScript: why is the script not working?
Good afternoon!
When hovering over an element of the collection, it is necessary to assign the class “nozoomed” to all its elements, and specifically to the element on which the mouse is hovered the class “zoomed”.
I do it like this:
// Получаю все нужные элементы
[].forEach.call(
// Привязываю перебор элементов коллекции с событию «mouseover»
document.querySelectorAll('nav#menu_3 > ul > li').addEventListener('mouseover', function(e) {
// Для всех элементов задаю класс «nozoomed»
e.classList.add('nozoomed');
// Для элемента на который наведена мышь задаю класс «zoomed»
this.classList.add('zoomed');
});
);
Answer the question
In order to leave comments, you need to log in
from selenium.common.exceptions import NoSuchElementException
try:
elem = driver.find_element_by_id('text')
return True
except NoSuchElementException:
print('Zero element for U!')
return False
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question