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
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
+ 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.
+ 1
Janningâ great! Thank you so much! đ
+ 1
You're welcome. Happy to help. đ
0
Janningâ you're right đ
I added it to the original post, thank you. đ