document.getElementById('sample') as HTMLInputElement code example Example: getelementbyid document.getElementById("someid");