Reputation: 745
I want to use font awesome tags in my javascript code. I am doing this in following way but it is not working.
if ($("#showOrderDetail_" + Id).css('display') == 'none') {
$("#showOrderDetail_" + Id).show();
$("#viewOrHideDetail_" + Id).html("Hide Details <i class='fa fa- chevron - up' aria-hidden='true'></i>");
} else {
$("#showOrderDetail_" + Id).hide();
$("#viewOrHideDetail_" + Id).html("View Details <i class='fa fa- chevron - down' aria-hidden='true'></i>");
}
Upvotes: 1
Views: 152
Reputation: 15603
A Class name conn't have space. If you have more than one class then give the each class name with space.
You code must be like this:
$("#viewOrHideDetail_" + Id).html("Hide Details <i class='fa fa-chevron-up' aria-hidden='true'></i>");
^^^^
check here
The class name is fa-chevron-up
in font-awesome.
Same for another line also.
Upvotes: 2