# Using Font Awesome 5 icon in JS

**URL:** <https://meta.discourse.org/t/using-font-awesome-5-icon-in-js/108727>\
**Category:** Development\
**Created:** [09.Февраль.2019 02:29:40 UTC](https://meta.discourse.org/t/using-font-awesome-5-icon-in-js/108727 "2019-02-09T02:29:40Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![zaino](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zaino/32/130057_2.png) [@zaino](https://meta.discourse.org/u/zaino)\
**Post date:** [09.Февраль.2019 02:29:40 UTC](https://meta.discourse.org/t/using-font-awesome-5-icon-in-js/108727/1 "2019-02-09T02:29:40Z")

</div>

I need some help here. I have read through all the threads regarding FA 5 and I am still not sure how to do this.

I want to use the FA icon as the link in an a tag within javascript. Here is how I would normally use the Twitter icon as the link, but it is not working:

```
if (userFields && userFields[userFieldId]) {
              const url = userFields[userFieldId];
              const link = "<a href='"+url+"' target='_blank'><i class="fab fa-twitter"></i></a>";
              return Ember.Object.create({ link, name: twitterUsernameField.get('name') });
            } else { ....

```

I am looking for a concrete example or the exact series of steps I need to take to get this to work.

Cheers

---

_[View the full topic](https://meta.discourse.org/t/using-font-awesome-5-icon-in-js/108727)._
