title: How to set the focus on a javascript modal window?
body: <p>Our website involves some javascript that produces overlay modal windows.</p>
  
  <p>There is one accessibility problem with this though, once the modal is triggered, the <code>focus</code> is still on the trigger element and not on the modal itself.</p>
  
  <p>These modals can include all sorts of html elements, headings, paragraphs and form controls. What I would like is the focus to begin on the first element within the modal, so most likely to be a h4 tag.</p>
  
  <p>I have explored using the <code>focus()</code> function however this does not work with a number of html elements.</p>
  
  <p>One thought was to add an empty <code>a</code> tag in the window which could gain the focus, but I am unsure about this method.</p>