Can’t access jQuery function in WordPress

Why am I getting the ReferenceError:

manualEntry is not defined error,

Read More

when using the following within WordPress?

<a href="#" onclick="manualEntry()">hide</a>
<script>
    jQuery(document).ready(function ($) {
         function manualEntry() {
              $("#details").hide();
         }
    });
</script>

Related posts

1 comment

  1. <a class="my_class" href="#">hide</a>
    
    <script>
        var $ = jQuery.noConflict();
        $(document).ready(function () {
             $( ".my_class" ).click(function( event ) {
                 event.preventDefault();
                 $("#details").hide();
             });
        });
    </script>
    

Comments are closed.