JSFiddle - React, Tailwind, and code Playground
by hescano
HTML
<div id="FileAttachments">
</div>
JavaScript
$(document).ready(function (){
var test = "<div id='attachmentsNote'>Special characters ~ # & % * ; , / \ { } | ' : < > ? ' are not allowed in file name.</div>\
<br>\
<div id='attachmentsDiv'></div>\
<div id='newAttachmentsDiv'>\
<input class='file-upload' type='file' id='fl1'>\
<label class='sizeLabel' id='sz1'></label>\
<label title='Clear Selected File' style='cursor: pointer; margin: 5px; color: Red;' id='rm1'>x</label>\
<img src='/Style Library/Images/PreviewFileIcon.png' style='cursor: pointer; display: none;' alt='Preview' width='20px' height='20px' id='pr1'>\
<br>\
</div>\
<div id='processAttachmentsDiv'></div>\
<div id='errorsDiv' class='errorsDiv col-md-12'></div>"
$("#FileAttachments").append(test);
$("#FileAttachments").find("input").trigger("click");
});