Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8346211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:56:11+00:00 2026-06-09T06:56:11+00:00

In a nutshell, I have a click event and it doesn’t seem to be

  • 0

In a nutshell, I have a click event and it doesn’t seem to be firing. jQuery is being loaded, and this is what I have for the jQuery:

<script type="text/javascript">
(function($) {
    $(".ajaxForm").click(function() {
        console.log('click');
    });
});
</script>

And the HTML

<div class="right">
<span class="ajaxForm" type="ajax"><span>Get Quote</span></span>
</div>

It’s probably just me being stupid, it’s been a long day. Anything stand out as being wrong? I’ve checked, double checked and triple checked the selector.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:56:12+00:00Added an answer on June 9, 2026 at 6:56 am

    You created the anonymous function, but you forgot to invoke it (self-invoking function). In this case, you will have to call it directly with the jQuery object as parameter. Code:

    <script type="text/javascript">
    (function($) {
        $(".ajaxForm").click(function() {
            console.log('click');
        });
    })(jQuery);
    </script>
    

    Obviously this function has to be called after that the DOM is loaded or after the .ajaxForm elements (otherwise he won’t find the elements to attach the event on and the event won’t be attached to the elements you want).

    If you want this function in the HEAD (or another JavaScript file), you will have to this:

    (function($) {
        $(document).ready(function() {
            $(".ajaxForm").click(function() {
                console.log("click");
            });
        });
    })(jQuery)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This I cant seem to figure out. In a nutshell I have a webpage
I have this code copied from C# 4.0 in a nutshell that uses Attribute/Reflection
I have a form that uses jQuery Validate. You click the Submit button, form
In a nutshell, I have a solution that builds fine in the IDE, and
I was reading C# 4 in a Nutshell and I've come to this piece
My controller, in a nutshell is this: chart1.SeriesCollection.Add(SC); using (MemoryStream ms = chart1.GetChartStream()) {
The Javadoc about String.intern() doesn't give much detail. (In a nutshell: It returns a
I have been stuck here for a good while and seem to nail the
i have came across the sentence in a nutshell while reading a technical book
In a nutshell , I want to have different faces for some types of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.