showing results for - "cannot read property 27classlist 27 of undefined"
Rafael
10 Jan 2018
1It means that document.getElementById("lastName") is returning undefined and you're trying to call classList on undefined itself.
2
3In your HTML input has the attribute name which equals lastName but there is no actual id="lastname"
4
5Either add the attribute id to your input or change getElementById to getElementsByName.
6
7Note that getElementsByName doesn't return a single item.
queries leading to this page
javascript js 3a2 uncaught typeerror 3a cannot read property 27classlist 27 of undefinedjs cannot read property 27classlist 27 of nullapp js 3a13 uncaught typeerror 3a cannot read property 27classlist 27 of undefined at htmldivelement squares 3ccomputed 3e onclick 28app js 3a13 29 c3 97 typeerror 3a cannot read property 27classlist 27 of undefinedscripts js 3a46 uncaught typeerror 3a cannot read property 27classlist 27 of null at popuphandler 28scripts js 3a46 29 at htmlbuttonelement 3canonymous 3e 28scripts js 3a61 29uncaught typeerror 3a cannot read property 27classlist 27 of undefined at htmlanchorelement alllnks 3ccomputed 3e onclick uncaught typeerror cannot read property 27classlist 27 of null javascripttypeerror cannot read property 27classlist 27 of null angularangular editor cannot read property 27classlist 27 of null atcore js 3a4081 error typeerror 3a cannot read property 27classlist 27 of undefinedcannot read property 27classlist 27 of null reactbootstrap 5 uncaught typeerror 3a cannot read property 27classlist 27 of undefinedcannot read property 27classlist 27 of undefined angularcannot read properties of undefined 28reading 27classlist 27 29 reactcannot read property 27classlist 27 of undefined reactcannot read property classlist of null jscore js 3a4442 error typeerror 3a cannot read property 27classlist 27 of undefinedhtml uncaught typeerror 3a cannot read property 27classlist 27 of undefinedcannot read property of classlist javascriptjquery property 27classlist 27 of nullcannot read property 27classlist 27 in class constructoruncaught typeerror 3a cannot read property 27classlist 27 of undefined at demo js 3a526uncaught typeerror 3a cannot read property 27classlist 27 of undefined bootstrap 5javascript uncaught typeerror 3a cannot read property 27classlist 27 of undefineddeal 3a38 uncaught typeerror 3a cannot read property 27classlist 27 of undefineduncaught typeerror 3a cannot read property 27classlist 27 of null at htmlbuttonelement 3canonymous 3e 28app js 3a52 29vue router uncaught typeerror 3a cannot read property 27classlist 27 of undefinedcannot read property 27classlist 27 of undefined angular 2test js 3a80 uncaught typeerror 3a cannot read property 27classlist 27 of undefinedcannot read property 27classlist 27 of undefined at htmlanchorelement 3canonymous 3etypeerror cannot read property 27classlist 27 of undefined in typescript 2020error 3a typeerror 3a cannot read property 27classlist 27 of nullionic typeerror 3a cannot read property 27classlist 27 of undefinedcannot read property 27classlist 27 of undefined in modalcannot read classlist of null angularcannot read property 27classlist 27 of undefined jquerycore js 3a4197 error typeerror 3a cannot read property 27classlist 27 of null at defaultdomrenderer2 removeclass angularvue 2b uncaught typeerror 3a cannot read property 27classlist 27 of undefineduncaught typeerror 3a cannot read property 27classlist 27 of undefined site 3astackoverflow comuncaught typeerror 3a cannot read property 27classlist 27 of undefined angularscripts js 3a7 uncaught typeerror 3a cannot read property 27classlist 27 of undefinedcannot read property 27classlist 27 of undefined at handlepagetransitioncannot read property 27classlist 27 of undefined at s 28main js 3a2 29cannot read property 27classlist 27 of undefined 5b0 5d classlistcannot read property 27classlist 27 of null jsuncaught typeerror 3a cannot read property 27classlist 27 of undefined at demo jsbootstrap cannot read property 27classlist 27 of undefineduncaught typeerror 3a cannot read property 27classlist 27 of undefined bootstraptypeerror 3a cannot read property 27classlist 27 of undefined at htmldivelement cannot read property 27classlist 27 of undefined vue c3 97 typeerror 3a cannot read property 27classlist 27 of nullypeerror 3a cannot read property 27classlist 27 of undefinedcannot read property 27classlist 27 of undefinedjquery router typeerror 3a cannot read property 27classlist 27 of nullcannot read property 27classlist 27 of undefined bootstraptypeerror 3a cannot read properties of undefined classlistcannot read classlist of undefinedangular uncaught typeerror 3a cannot read property 27classlist 27 of undefineduncaught typeerror 3a cannot read property 27classlist 27 of nullcannot read property 27classlist 27 of undefined containscore js 3a4197 error typeerror 3a cannot read property 27classlist 27 of null at defaultdomrenderer2 removeclasserror typeerror 3a cannot read property 27classlist 27 of null at emulatedencapsulationdomrenderer2 removeclasstypeerror cannot read property 27classlist 27 of undefined in tserror 3a uncaught typeerror 3a cannot read property 27classlist 27 of nullscript js 3a16 uncaught typeerror 3a cannot read property 27classlist 27 of nullcannot read property 27classlist 27 of undefined vue3custom js 3a30 uncaught typeerror 3a cannot read property 27classlist 27 of undefinedmainui js 3a749 uncaught typeerror 3a cannot read property 27classlist 27 of nullcannot read property 27classlist 27 of null javascript cannot read property 27classlist 27 of undefinedcannot read properties of undefined 28reading 27classlist 27 29 react jstypeerror 3a cannot read property e2 80 98classlist e2 80 99 of nulltypeerror 3a cannot read property 27classlist 27 of undefined at appcomponent ontoggleerror typeerror 3a cannot read property 27classlist 27 of undefinedapp js 3a32 uncaught typeerror 3a cannot read property 27classlist 27 of nullcannot read property 27classlist 27 of undefined react functionscript js 3a17 uncaught typeerror 3a cannot read property 27classlist 27 of undefinedmain js 3a72 uncaught typeerror 3a cannot read property 27classlist 27 of nullcustom js 3a33 uncaught typeerror 3a cannot read property 27classlist 27 of null attypeerror 3a cannot read property 27classlist 27 of nullbootstrap uncaught typeerror 3a cannot read property 27classlist 27 of undefinedcannot read property of undefined 28reading 27classlist 27 29 bootstrap 5main js 3a5 uncaught typeerror 3a cannot read property 27classlist 27 of undefinedcannot read property 27classlist 27 of undefined bootstrap 5cannot read properties of undefined 28reading 27classlist 27 29index start html 3a69 uncaught typeerror 3a cannot read property 27classlist 27 of nullcannot read property classlist of undefinedcannot read property 27classlist 27 of undefined react function site 3astackoverflow comcannot read property 27classlist 27 of undefined in typescriptuncaught typeerror 3a cannot read property 27classlist 27 of undefined jquery 3 4 1uncaught typeerror 3a cannot read property 27classlist 27 of undefined reactjscannot read property 27classlist 27 of undefined 22scripts js 3a46 uncaught typeerror 3a cannot read property 27classlist 27 of nullcannot read property 27classlist 27 of undefined at cannot read properties of undefined 28reading 27classlist 27 29 22 vue 28index 29 3a162 uncaught typeerror 3a cannot read property 27classlist 27 of nulluncaught 28in promise 29 typeerror 3a cannot read property 27classlist 27 of undefined vuecannot read property 27classlist 27 of nulluncaught 28in promise 29 typeerror 3a cannot read property 27classlist 27 of undefinedcannot read property 27classlist 27 of undefined dropdown jscore js 3a5973 error typeerror 3a cannot read property 27classlist 27 of nullcannot read property 27classlist 27 of undefined dropdowncannot read property classlist of undefined bootstraperror cannot read property 27classlist 27 of undefinedvue cannot read property 27classlist 27 of undefinedbootstrap typeerror 3a cannot read property 27classlist 27 of undefinedcannot read property of undefined 28reading 27classlist 27 29typeerror 3a cannot read property 27classlist 27 of undefined ionicreact css typeerror 3a cannot read property 27classlist 27 of nullscript js 3a18 uncaught typeerror 3a cannot read property 27classlist 27 of null at window onscrolljavascript cannot read property 27classlist 27 of undefinedtypeerror 3a cannot read property of undefined 28reading 27classlist 27 29react cannot read property 27classlist 27 of null 28index 29 3a161 uncaught typeerror 3a cannot read property 27classlist 27 of undefinedtypeerror 3a cannot read property 27classlist 27 of undefinedmagazine 3a644 uncaught typeerror 3a cannot read property 27classlist 27 of undefineddropdown js 3a141 uncaught typeerror 3a cannot read property 27classlist 27 of undefineduncaught typeerror 3a cannot read property of undefined 28reading 27classlist 27 29typeerror 3a cannot read property 27classlist 27 of undefined reactapp js 3a31 uncaught typeerror 3a cannot read property 27classlist 27 of nullcustom js 3a33 uncaught typeerror 3a cannot read property 27classlist 27 of null at linkuncaught typeerror cannot read property of undefined 28reading 27classlist 27 29uncaught typeerror 3a cannot read property 27classlist 27 of undefinedcannot read property 27classlist 27 of undefined storybookread properties of undefined 28reading 27classlist 27 29cannot read property 27classlist 27 of undefined