function makeElement(elem, cssClasses, elemID){
    let theClasses = [];
    if(cssClasses != undefined) theClasses = cssClasses.split(', ');
    if(typeof elem !== "undefined" && elem.trim() !== ''){
        const newElem = document.createElement(elem);
        if (theClasses.length > 0 && theClasses[0] !== '') {
            theClasses.forEach(cssClass =>
            newElem.classList.add(cssClass));
        };
        if (elemID != undefined && elemID != '') newElem.setAttribute("id", elemID);
        
        return newElem;
    } 
}
/* Make and element
    elem: string {required} -  type of DOM element you want to create
    cssClasses: string {optional} -  can be comma deliminated to attach multiple classes
    elemID: string {optional} - Element ID is needed
*/
Make and element
elem: string {required} -  type of DOM element you want to create
cssClasses: string {optional} -  can be comma deliminated to attach multiple classes
elemID: string {optional} - Element ID is needed
Make and element elem : string { required } - type of DOM element you want to create cssClasses : string { optional } - can be comma deliminated to attach multiple classes elemID : string { optional } - Element ID is needed
function makeElement(elem, cssClasses, elemID){
    let theClasses = [];
    if(cssClasses != undefined) theClasses = cssClasses.split(', ');
    if(typeof elem !== "undefined" && elem.trim() !== ''){
        const newElem = document.createElement(elem);
        if (theClasses.length > 0 && theClasses[0] !== '') {
            theClasses.forEach(cssClass =>
            newElem.classList.add(cssClass));
        };
        if (elemID != undefined && elemID != '') newElem.setAttribute("id", elemID);
        return newElem;
    } 
}
function makeElement ( elem , cssClasses , elemID ) { let theClasses = [ ] ; if ( cssClasses != undefined ) theClasses = cssClasses . split ( ', ' ) ; if ( typeof elem !== "undefined" && elem . trim ( ) !== '' ) { const newElem = document . createElement ( elem ) ; if ( theClasses . length > 0 && theClasses [ 0 ] !== '' ) { theClasses . forEach ( cssClass => newElem . classList . add ( cssClass ) ) ; } ; if ( elemID != undefined && elemID != '' ) newElem . setAttribute ( "id" , elemID ) ; return newElem ; } }
Make and element
elem: string {required} -  type of DOM element you want to create
cssClasses: string {optional} -  can be comma deliminated to attach multiple classes
elemID: string {optional} - Element ID is needed
Make and element elem : string { required } - type of DOM element you want to create cssClasses : string { optional } - can be comma deliminated to attach multiple classes elemID : string { optional } - Element ID is needed