Without third party libs, use something like
const inputElements = parentElement.getElementsByTagName('input')
if (inputChilds.length > 0) {
inputChilds.item(0).focus();
}
Make sure you consider all form element tags, rule out hidden/disabled ones like in other answers and so on..