CarrotCrop
CarrotCrop

Reputation: 73

How To Put FontAwesome In Inner.html

How am I suppose to put fontawesome icon i.e

`<i class="fa fa-info" aria-hidden="true"></i>

`in a place of "Info" in below inner.html
Below is my javascript

dlg.innerHTML = "<span class='alert-headingg'>Info<" + "/span>";

Upvotes: 0

Views: 2322

Answers (2)

Harshit Trivedi
Harshit Trivedi

Reputation: 782

<i class="icon-github"></i>

div.github:before
{
   content: "\f09b";
   font-family: FontAwesome;
}

Upvotes: 0

Sikandar_ali
Sikandar_ali

Reputation: 174

Try this You have to just put your icon element inside your span.It will work for you.

dlg.innerHTML = "<span class='alert-headingg'><i class="fa fa-info" aria-hidden="true"></i></span>";

Upvotes: 1

Related Questions