I have as simple webpage where dates and names are input into form fields and fields and transmitted in context in paragraphs when the user clicks a button. Some are output to spans, using InnerHTML others to inputs.
Some dates/names must appear multiple time in the document. I need to my code to apply to apply to all boxes with that actual ID. Should I instead be using a class?
Example this outputs a date:
// This Defines the Date the Medical Was received
var MEDRName = document.getElementById("MEDRName");
var elements = document.getElementsById("OUTMEDR");
for(var i = 0, len = elements.length; i < len; i++){
elements[i].onclick = function () {
var OUTMEDR = document.getElementById("OUTMEDR");
var name = MEDRName.value;
This appears in multiple paragraphs, and I need each element with this ID to populate.
<p> The medical was signed by <input type="text" id="MEDRNAME" /> </p>
<p><input type="text" id="MEDRNAME" /> indicated that yadayadayada</p>