I have created a clickable area in an image and I want to get the Id of this area in Javascript so I can fill it with color. I am new in both html and js.
var myElement = document.getElementById("map1");
<img src={marina} alt="marinamap" usemap="#workmap" />
<map name="workmap">
<area shape="rect" coords="320,220,340,210" alt=" parking" href="" id="map1" >
</map>
I am getting the error :
a constructor,method,accessor or property was expected.
Any advice?