I'm struggling to figure out why I can't change a font awesome icon using a toggle. I've tried various solutions but nothing seems to be working. Any insights on what might be causing this issue?
(HTML)
<span class="toggle-icon"><i class="far fa-eye" id="password-see"></i></span></div>
(CSS)
.toggle-icon {
cursor: pointer;
}
(Javascript)
$(document).ready(function () {
$('toggle-icon').click(function () {
$('i').toggleClass('far fa-eye far fa-eye-slash');
});
});
Any assistance or guidance would be highly appreciated!