How to change an image SRC (source) using JavaScript !

preview_player
Показать описание
in this tutorial, I try to show how we can change an image src using JavaScript. I use onclick attribute in order to firstly to select the html element and eventually change its value.. enjoy it.
welcome to my channel:

web reference:
Рекомендации по теме
Комментарии
Автор

Hi, I am a beginner and I'm really interested in learning javascript can u guide me as where can I start my journey from?

tahafaisal
Автор

Is there a way to change an img src from a button of a page to another page?

Like if you click a button on page1.html but the image change should be in page2.html

winoroz