![]() 2 solutions Top Rated Most Recent Solution 1 May be your problem is 'on' method.Instead of that use 'live'.If your jQuery is older than 1.7 then 'on' method is not working.So try with 'live' method. The correct function name is getElementById(): var elem = document.getElementById('ID') 2. Debug the code and see what is happening. Running the above code leads to the following Javascript error: TypeError: document.getElementByID is not a function TypoĪ typical scenario for the TypeError: "x" is not a function to occur is when there is a typo in the called function name: var elem = document.getElementByID('ID') TypeError: "x" is not a function Examples 1. When the called function is within a scope that is not accessible.When calling a built-in function that expects a callback function argument, which does not exist.A TypeError: "x" is not a function occurs when a function is called on an object that does not contain the called function.When a function is called on a property that is not actually a function. ![]() What Causes TypeError: "x" is not a functionĪ TypeError: "x" is not a function in Javascript generally occurs in one of the following scenarios: You will never find changingchange inside that div Since IDs must be unique within a document, just use the ID: ('overlay'). The parent of your button is
.
![]() The Javascript error TypeError: "x" is not a function occurs when there is an attempt to call a function on a value or object, which is not actually a function.Įrror message: TypeError: "x" is not a function Re: Jquery not working - trying to show / hide div when a button is clicked 7 years ago Your DOM navigation is wrong. ![]()
0 Comments
Leave a Reply. |