I think the Topic explains it good enough
Javascript
https://www.techiedelight.com/dynamically-generate-input-type-button-javascript/