Random quote machine!

Hey guys, i need a little help. If you open my code pen, you will se that both my buttons (generate quote, and share quote), they both generate a quote. How do i select a specific button in javascript? one should generate it, and other should share it on twitter. Any clues?

here is my pen:

You could select a button based on ID.
https://www.w3schools.com/tags/att_global_id.asp
http://api.jquery.com/id-selector/

Demo

https://jsfiddle.net/s9amtq5k/6/

1 Like

well yes, but if you look my code, you can see that i have UL classes, and i, e subclasses…how can i change from there? i dont want to change everything to <button :confused:

btw, if i try to <button, and if i try to put some of my bootstrap icons in it, it doesnt work (twitter icon is not showing)btnbtn

yes i know that, and thats what i am trying to change, but i try to keep my UL and Li classes, instead of changing everything to <button, but i dont know where can i put an ID, so i can sepereate them. feeling lost a bit

ah ok i solved it, thank you guys for helping.