I am creating simple election map, that visualize the result over the county by Some election races, which I listed them on accordion Panel. I tried to follow this example , to render the feature layer. I failed to Add the following
1- Add on Click Events on the Race Accordion header then render the map according. by replacing the field names in the Arcade Expression
(on console log I was able to get all the fields name)
2- instead of placing the arcade expression on the HTML file (script tag) How can I add it to my separated js file(script.js).
I do appreciate your help.
Attaching my code so far.