0
Replace image src without an ID tag on
How can I replace the image src and header which do not have an ID tag on. I can only edit the js and css file. <div id="funded_courses"> <img src="images/funded_courses.jpg"/> <h3>Header</h3> <div id="imageText" class="leftText spacing">The Credit .......</div> <hr/> <span id="image1" class="dot"></span> <span id="image2" class="dot"></span> <span id="image3" class="dot"></span> </div>
4 Respostas
+ 1
document.querySelector('#funded_courses img').src = 'new.jpg';
+ 1
Thank you very much Calviղ ! How can I amend the <h3>Header<h3> part in javascript file? Many thanks in advance.
+ 1
Calviղ Thank you very much! Have been spending hours trying to solve based on the div ID😭
0
document.querySelector('#funded_courses h3').innerText = 'New text';