I want to ask that how I should code a Javascript function that on click to btn_1 main function should execute and during the execution of the main function, the sub-function append to the div which I have created in the main function.
document.getElementById('btn_1').addEventListener('click', main);
function subfunc(){
const h1 = document.createElement('h1');
h1.appendChild(document.createTextNode('it is working'));
h1.id = 'heading';
}
function main(){
const div = document.createElement('div');
div.className = 'main-showcase'
}