I am trying to add a javascript class show with dropdown-content, but it is not adding there infact while console logs are working perfectly fine upto the last scope of the javascript script tag. Can anyone help me out from this?
The text with the id is basically coming from django database which is unique.
<div class="eps_dots more_dropdown dropdown">
<a href="#" onclick="get()" id="{{course.course_id}}" class=""><i class="uil uil-ellipsis-v"></i></a>
<div class="dropdown-content ">
<span><i class="uil uil-heart"></i>Save</span>
<span><i class="uil uil-ban"></i>Not Interested</span>
<span><i class="uil uil-windsock"></i>Report</span>
</div>
</div>
<script>
function get() {
const focused = document.activeElement.getAttribute("id");
console.log(focused);
menu(focused);
}
function menu(focused) {
const path = '#' + focused + ' .dropdown-content';
console.log(path);
$(path).toggleClass("show");
}
</script>
.eps_dots .show{
display: block !important;
}