add value to id javascript code example
Example 1: Javascript get text input value
var inputValue = document.getElementById("myTextInputID").value;
Example 2: javascript change element id
var element = document.getElementById("oldID");
element.id = "newID";