title: Putting data-index in Javascript code
body: <p>I have an html form that has some fields generated by a js file. I'm trying to figure out how to add the "data-index" into the javascript code and I'm not finding any documentation on how to add it (maybe I'm googling the wrong things)</p>
  
  <p>Here is a brief snippet of the code in the js file:</p>
  
  <pre><code>   const serialInput = createDomElement("input", "form-control")
              serialInput.name ="serial " + device_id
              serialInput.placeholder="10 characters"
              serialInput.required = true
              serialInput.className ="form-control"
              serialInput.minLength = "10"
              serialInput.maxLength = "10"
  </code></pre>
  
  <p>I need to add the <code>data-index="x"</code> to that code. Any help is greatly appreciated.</p>