function showChannels(objList, elmName) {
    // Clear previous child elements if content is updated
    let channelsNode = document.getElementById(elmName);
    while (channelsNode.firstChild) {
        channelsNode.removeChild(channelsNode.firstChild);
    }

    objList.forEach(function(obj) {
        let node = document.createElement('option');
        let textNode = document.createTextNode(obj);
        node.append(textNode);
        node.setAttribute("value", obj);
        document.getElementById(elmName).appendChild(node);
    });
}
// The following function dynamically shows the list of channels stored from the server
The following function dynamically shows the list of channels stored from the server
The following function dynamically shows the list of channels stored from the server
function showChannels(objList, elmName) {
    let channelsNode = document.getElementById(elmName);
    while (channelsNode.firstChild) {
        channelsNode.removeChild(channelsNode.firstChild);
    }
    objList.forEach(function(obj) {
        let node = document.createElement('option');
        let textNode = document.createTextNode(obj);
        node.append(textNode);
        node.setAttribute("value", obj);
        document.getElementById(elmName).appendChild(node);
    });
}
function showChannels ( objList , elmName ) { let channelsNode = document . getElementById ( elmName ) ; while ( channelsNode . firstChild ) { channelsNode . removeChild ( channelsNode . firstChild ) ; } objList . forEach ( function ( obj ) { let node = document . createElement ( 'option' ) ; let textNode = document . createTextNode ( obj ) ; node . append ( textNode ) ; node . setAttribute ( "value" , obj ) ; document . getElementById ( elmName ) . appendChild ( node ) ; } ) ; }
The following function dynamically shows the list of channels stored from the server
The following function dynamically shows the list of channels stored from the server
// Clear previous child elements if content is updated