OK so I'm appending HTML elements to the DOM with this following javascript..
$h.each(domNodes, function(domNode) {
var input;
input = document.createElement('input');
input.setAttribute('type', 'file');
input.setAttribute('id', 'image-file');
input.setAttribute('name', 'files[]');
input.style.display = 'none';
domNode.addEventListener('click', function(){
input.style.opacity = 0;
input.style.display='block';
input.focus();
input.click();
input.style.display='none';
}, false);
domNode.appendChild(input);
}
}
And this creates a line of HTML that looks like this...
<input type="file" id="image-file" name="files[]" multiple="multiple" style="display: none;" />
What would the javascript look like to create HTML output that looks like this...
<input type="file" name="files[]" id="image-file" multiple />
<label class="file-button" for="image-file" >
<img src="img/upload.png" alt="add"> Upload Your File(s)
</label>
I'm not sure how to nest HTML tags within other HTML tags with pure javascript, so any help would be greatly appreciated.