How to create div dynamically on click

Paste the following code to create text box dynamically: How to create div dynamically on clickexpoundsofttechsolution How to create div dynamically on click
<div class="my_div"></div>
<button class="cbclass">Add Text Box </button>
<script>  $(document).on('click','.cbclass',function() 
         { 
 const create_div1 = document.createElement("div");
const create_element1 = document.createElement("input");
 create_div1.appendChild(create_element1);
$('.my_div').append(create_div1);
        });                                   
<script>