Good day.
It is necessary that depending on the selected select text is added after the next input field.
For example: if I chose Россия in select , then after input руб added, I chose the США - a долл added долл and so on.
There is a code, but, as you understand, it does not work:
function insertAfter(referenceNode, newNode) { referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); } function createText() { var selectValue = document.getElementById("money").value; var CashInput = document.getElementById("cash"); var temp = document.createElement("p"); if (selectValue == "rub") { var text = "rub"; temp.appendChild(text); insertAfter(CashInput, temp); } } <select id="money" onchange="createText();"> <option value="rub">Russia</option> <option value="doll">USA</option> </select> <input id="cash">