Вот что я получил. Причем я получил теги, а мне нужно получить src последнего тега.
script.js:38 <img src="images/8.gif" alt="pearl">
script.js:38 <img src="images/5.gif" alt="pearl">
script.js:38 <img src="images/3.gif" alt="pearl">
script.js:38 <img src="images/10.gif" alt="pearl">
script.js:38 <img src="images/8.gif" alt="pearl">
script.js:38 <img src="images/6.gif" alt="pearl">
script.js:38 <img src="images/5.gif" alt="pearl">
script.js:38 <img src="images/3.gif" alt="pearl">
script.js:38 <img src="images/1.gif" alt="pearl">
script.js:38 <img src="images/10.gif" alt="pearl">
script.js:38 <img src="images/8.gif" alt="pearl">
script.js:38 <img src="images/6.gif" alt="pearl">
script.js:38 <img src="images/4.gif" alt="pearl">
script.js:38 <img src="images/3.gif" alt="pearl">
script.js:38 <img src="images/1.gif" alt="pearl">
script.js:38 <img src="images/9.gif" alt="pearl">
script.js:38 <img src="images/8.gif" alt="pearl">
script.js:38 <img src="images/7.gif" alt="pearl">
А когда прописываю document.querySelector('.carousel_1 :nth-child(2)').src получаю
file:///D:/Downloads/dz_kazino/dz_kazino/images/1.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/8.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/6.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/5.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/3.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/1.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/9.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/7.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/4.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/2.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/1.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/9.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/7.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/6.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/5.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/4.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/3.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/2.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/1.gif
script.js:38 file:///D:/Downloads/dz_kazino/dz_kazino/images/10.gif
Может я не по тому пути иду?
Когда пишем document.querySelectorAll, мы получаем массив? Или я ошибаюсь?
Последний раз редактировалось Javany11, 03.04.2018 в 13:06.
|