Onclick function “is not defined”
-
The following code appears in a php file that is called from the content.php file using get_template_part.
<div onclick="checkAllTopicCheckBoxes()"> </div>I added the following code to the bottom of the function.php file:
function checkAllTopicCheckBoxes() { alert("Hello! I am an alert box!!"); }When I click the element it returns:
(index):363 Uncaught ReferenceError: checkAllTopicCheckBoxes is not defined.Can anyone please help me? At the moment I have it at the top of my the php file that is being called with get template within <script>. Is there any disadvantage to this?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Onclick function “is not defined”’ is closed to new replies.