skip to Main Content

How to create a loop for the following code? – Jquery

I wrote the following code: $("#img1").add("#label1").fadeIn(); $("#img1").click(function() { $(this).attr("src", "/abc/xyz.png"); $("#content1").add("#img2").add("#label2").fadeIn(1000); }); When I click on img2, the image source ishould change and content2 as well as img3 / label3 should be displayed.When I reach img5, just content5 should be…

VIEW QUESTION

Include image alt text with jQuery text()

With this HTML: <h1>This is my <img src="https://dummyimage.com/100x50/000/fff&text=BIG" alt="BIG"> title</h1> In Chrome or Firefox, if I select the rendered text and copy it (Ctrl-C), I'll get This is my BIG title (the alt text of the image is included in…

VIEW QUESTION
Back To Top
Search