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