I want to create a simple div element in html with vanilla JS. I am trying to add EventListener to a button to create a div on click , but strange situation happening as i can't figure it out why?
I am trying to create a div under that [div element with container-div class], when i will click the button. But when i clicking it function createDiv can't tale argument for height parameter. why it's happening? Help me please , much appreciated.
This pic for directly calling function before clicking button

In this pic red bordered area is growing after i clicked button several times

I am trying to create a div without fill but ....
function createDiv(
height = "200px",
width = "200px",
border = "solid 1px red"
) {
const div = document.createElement("div");
div.style.height = height;
div.style.width = width;
div.style.border = border;
document.getElementsByClassName("container-div")[0].appendChild(div);
return div;
}
const createDivbtn = document.getElementById("createDiv");
createDiv();
createDiv(undefined, undefined, "solid 5px blue");
createDivbtn.addEventListener("click", createDiv);
<div class="row">
<div class="col-6">
<button id="createDiv" class="btn btn-outline-black1">
Create Div
</button>
</div>
<div class="col-6 container-div"></div>
</div>
createDivbtnto add an event listener to