I'm completely new to JS and struggling a bit, so please be patient. I've been searching online for a few days now without much luck. I'm using Bootstrap 4 and trying to create an accordion with a +/- icon that changes when expanded or collapsed. In essence, I want to replicate this demo: http://www.bootply.com/89084#
My basic JSFiddle almost works, but it doesn't collapse the opened accordion when a new one is clicked (bonus points if you can help me with that). https://jsfiddle.net/fufwwy7j/2/
However, when I try to load the HTML file locally, I get an error saying 'Uncaught ReferenceError: $ is not defined'. Could this be the root of the issue? Both the HTML and JS files are in the same directory, and the script tag in my <head>
section looks like this:
<script src="plusminus.js"></script>
.