How to replace image of SVG with inline SVG but keep dropdown-toggle class

How can I replace my current img of an SVG to use an inline SVG but ensure that I can apply a class to it in order to keep the dropdown toggle functionality and custom css styles?

Currently Using:

<img src="/assets/images/icons/close.svg" class="dropdown-toggle" alt="close" />

Want to use:

<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.875 1.95648L14.0435 0.125L8 6.16852L1.95648 0.125L0.125 1.95648L6.16852 8L0.125 14.0435L1.95648 15.875L8 9.83148L14.0435 15.875L15.875 14.0435L9.83148 8L15.875 1.95648Z" fill="black"/>
</svg>

but also keep a class applied to it, for JS and CSS purposes.