how to select an element by id js code example Example: select element by id js var element = document.getElementById(id);