Trouble With Toggle Button with 2 Icons Using Font Awesome
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I was using Material Icons but changed to Font Awesome and am having some trouble converting over. Here's a link to my JSFiddle: http://jsfiddle.net/code4ever/g69puzfx/. What I'm trying to do is have it go from being https://fontawesome.com/icons/pen-alt?style=solid to https://fontawesome.com/icons/hand-paper?style=solid and back again, but I can't figure out how that'd work.

What am I doing wrong here?

Thanks.

awarded to enderdba
Tags
javascript

Crowdsource coding tasks.

1 Solution

Winning solution

Here's an approach:

http://jsfiddle.net/enderdba/67ocwk80/2/

You were using the wrong query selector, and using a wrong set value. You need to select the <i> that's inside your select element. And also, you don't need to change the text value, you need to change the class attribute so it changes icon properly.

Thanks @enderba!
sharper 5 months ago