There is a code for php, I need that when I click on a button, the picture of the main background changes to another specific picture.

echo("<button class='new'> "); echo ( " <a href=\"$i.png\",>Просмотр</a> "); echo ( " </button> " ); echo("</div>"); 
  • Nobody knows? - Martix
  • This is solved using Javascript and CSS. Thousands of examples can be found on the Internet. - zhenyab
  • Found none for the button - Martix

1 answer 1

 <button style="width:300px;height:100px;" onClick="this.style.backgroundImage = 'url(https://www.w3schools.com/cssref/w3css.gif)';"> button text </button>