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 8615525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:23:57+00:00 2026-06-12T05:23:57+00:00

this is absolutely driving me crazy! Can someone please explain why this code isn’t

  • 0

this is absolutely driving me crazy! Can someone please explain why this code isn’t working and how to fix it? It should be sending the message “click” to the console but it is not working. Console messages work everywhere else, but for some reason javascript is not capturing the click event.

var resultsListView = new ResultsListView({model: comparablesList});

ResultsListView = Backbone.View.extend({
        tagName:'div',
        id:'resultView',
        template:_.template("<div class='resultsListItemView'></div>"),

        initialize:function () {
            $( this.el ).html('<p class="loadingText">Getting comparables...<p>');
            this.model.bind("change", this.render, this);
            this.model.bind("reset", this.loading, this);
        },

        render:function (eventName) {
            $( this.el ).html( this.template() );

            _.each(this.model.models, function (comparable) {
                this.$('.resultsListItemView').append(new ResultsListItemView({model:comparable}).el);
            }, this);

            $('#info').html($(this.el));

            return this;
        }
    });

    ResultsListItemView = Backbone.View.extend({
            initialize: function(){
                this.render();
            },

            template:_.template("<div class='hovr_item'> \
                                    <div class='hovr'> \
                                        <button class='test123'>test</button> \
                                    </div> \
                                </div> "),

            render: function(){
                var resultsListItemView = this;
                $(this.el).html(this.template(this.model.toJSON()));

                $(this.el).find('.test123').click(function() {
                    console.log('click'); // this does not work after clicking
                });
                return this;
            }
        });

As an extra clue, if I put this code into render it does show up in the console… so it appears to be only the click event:

$(this.el).find('.test123').each(function(index) {
        console.log('found');
    });
  • 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-12T05:23:59+00:00Added an answer on June 12, 2026 at 5:23 am

    Have you tried binding this event with the events attribute? ie:

    events: "click .test123": "affiliateClick"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm hoping someone can help with this, as it's driving me absolutely nuts. I
Hey guys, this is driving me absolutely crazy! Been searching for hours and can't
This is driving me absolutely crazy. I have a package that was working fine,
Please check this code out it compiles and runs absolutely fine.. The question is
This is absolutely driving me crazy. I have the Droid X 2.3.3. For some
This is driving me crazy already and by now I'm absolutely hopeless :( Here
This bug is driving me absolutely crazy. I'm trying to filter a number of
This one is driving me absolutely crazy. I tested updating user's email address on
This is so damn stupid but driving me absolutely fing crazy. <input type=radio name=OptGroup
this is driving me absolutely crazy. I'm trying to deploy an application to one

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.