Issue
I'm making a button
using createElement
in javascript.
I want to add a bootstrap delete icon in that button
.
My code -
const aLink = document.createElement('button');
aLink.innerHTML = '<i class="bi bi-trash"></i> Delete'
document.body.append(aLink);
In chrome only a button appears with Delete written inside it. I've already included bootstrap stylesheet and script files in my HTML.
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
Solution
You are missing the link of the icons.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.0/font/bootstrap-icons.css">
Answered By - Jairo Rodriguez
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.