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