title: Add js to MapBox popup
body: <p>Currently I have a mapbox map that outputs markers, each marker popup has a link within it, once clicked it will only show markers relative to the original marker clicked. <a href="https://i.stack.imgur.com/l9S1o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l9S1o.png" alt="enter image description here"></a></p>
  
  <p>The view areas link is structured like: </p>
  
  <p><code>&lt;p class="view_areas" id="123"&gt;View Areas&lt;/p&gt;</code></p>
  
  <p>And the resulting js like:</p>
  
  <p><code>$('.view_areas').click(function() {console.log('test')})</code></p>
  
  <p>However clicking the link fails to produce any sort of result from the console. Is this because the marker doesn't exist on the DOM until it is clicked? I've also attempted doing: </p>
  
  <p><code>&lt;p class="view_areas" id="123" onClick="view_areas()"&gt;View Areas&lt;/p&gt;
  &lt;script&gt;function view_areas(){ console.log('test'); }&lt;/script&gt;</code></p>
  
  <p>But this produces a function not found error. Basically the link will serve as a toggle, however because of the large amount of markers that will be on the screen, using layers would be a bit impractical.</p>