Adding a FontAwesome Icon

Include the CDN to your HTML header tag

<head>
    <!-- Font Aweseome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>

If adding the icon inline to your HTML page the following will suffice

<i class=”fa fa-plane” aria-hidden=”true”>

If using DOM manipulation using JavaScript, the following can be done

const link = document.createElement("a") 
const icon = document.createElement("i")
icon.classList.add("fa", "fa-plane", "fa-2x")
icon.ariaHidden = true
link.href = race.flights
link.target = "_blank"
link.append(icon)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s