0

Help with functions!

Hey everyone! I'm trying to write a function that allows a specific svg to move left if clicking on a ⬅️ and right on a ➡️. Could someone give me some examples of valid funcs to achieve that? Thanks from the bottom of my noob heart. Link to the project: https://code.sololearn.com/Wua0CdzHHR64/?ref=app

28th Oct 2018, 4:53 PM
Manuel Barberini
Manuel Barberini - avatar
5 Answers
+ 1
It might be easier if you provided a link to your Code Playground project so we can refer to the specific svg and arrows in discussion. More generically speaking, when you want something to move as a response to the user clicking something (generally an element), you will want to use some form of onclick. You can take a look at some of the ways here: https://www.w3schools.com/jsref/event_onclick.asp
29th Oct 2018, 6:20 AM
Janning⭐
Janning⭐ - avatar
+ 1
This should get you started: https://code.sololearn.com/Wpti4UKXemSW/?ref=app I used the cloud because there were two elements with the man id.
30th Oct 2018, 4:15 AM
Janning⭐
Janning⭐ - avatar
+ 1
Janning⭐ great! Thank you so much! 😊
30th Oct 2018, 6:17 AM
Manuel Barberini
Manuel Barberini - avatar
+ 1
You're welcome. Happy to help. 😊
30th Oct 2018, 6:18 AM
Janning⭐
Janning⭐ - avatar
0
Janning⭐ you're right 😅 I added it to the original post, thank you. 😊
29th Oct 2018, 6:51 AM
Manuel Barberini
Manuel Barberini - avatar