+ 1

How can i make a button and when clicked goes to the with thesame background.

how to make a button that when clicked the the thing under the button Will Change without the use of a href using JavaScript like the one in Magic tricks. can some one explain to me? https://code.sololearn.com/WR6mrmI4KsuK/?ref=app

30th Aug 2017, 8:13 PM
Sewedo🌞🌻
Sewedo🌞🌻 - avatar
3 Réponses
+ 6
@Empty: Yes, but targeting another element than a button parent, if I right understand the question ;)
30th Aug 2017, 9:27 PM
visph
visph - avatar
+ 5
This code doesn't use 'href' but use JS anyway, through the 'onclick' event handler attribute... where function of the JS tab (global scope of the document) are called. In the called function are instruction to select targeted html element through the use of document.getElementById() method, and then update properties/content ^^
30th Aug 2017, 8:33 PM
visph
visph - avatar
+ 1
@Empty thanks very much Thats what i needed
30th Aug 2017, 10:20 PM
Sewedo🌞🌻
Sewedo🌞🌻 - avatar