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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:54:01+00:00 2026-06-11T13:54:01+00:00

I have the following HTML structure,which is a handlebars.js template.: <div class=row id={{serviceId}}> <div

  • 0

I have the following HTML structure,which is a handlebars.js template.:

<div class="row" id="{{serviceId}}">
            <div class="favorites" isfavorite="{{isFavorite}}">
                <img src="{{favImg}}" style="width:25px;">
            </div>
            <!-- end .favorites -->
            <div class="service">
                <p class="title">{{serviceName}}</p>
            </div>
            <div class="small serviceStat">

            </div>
            <div class="small metric">

            </div>
            <div class="performance"></div>
            <div class="icon email">
                <img src="../images/email.png" style="width:27px">
            </div>
        </div>

When i try to bind an event to the email class using the .on() method it does not work:

$('.row').on('click','.email',function(){alert('clicked')});

 //or like this:
$('.email').on('click',function(){alert('clicked')});

But if i bind it with live it works:

$('.email').live('click',function(){alert('clicked')});

any idea what might cause it?

  • 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-11T13:54:03+00:00Added an answer on June 11, 2026 at 1:54 pm

    The issue is you need to bind your delegate handler ABOVE [the location where your .row elements are going to exist] in the DOM…

    If you have:

    <div id="item-container">
        <!--divs with class row go in here -->
    </div>
    

    you need to do this:

    $('#item-container').on('click', '.email', function() {alert('clicked'); });
    

    The reason for this is instances of your template do not exist in the DOM at document ready…so you need to bind the event to an element that does exist…aka, the item-container

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following HTML structure: $('#subgroup a').nextUntil('h3').wrapAll('<div></div>'); <script src=https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js></script> <div id=subgroup> <h3>Group name
I have the following structure. <div> <p>Hello World !!</p> </div> <iframe id="myiframe" src='myiframeContent.html'></iframe> and
I have to create the following type of HTML structure: <div id=dcontent> <ul class=thm>
I have a drop down menu which has the following html structure: <ul class=menu>
I have the following html structure (which is generated and I can't change): <table
i have this following html structure usilg ul and li. <ul class=treeview id=productTree> <li
I have the following html structure <div> text 1 <div> text 2 <div> text
In my rails view(index.html.erb), i have following structure <div> <%= render :partial => create
I have a following div structure <div id=wrapper> <div id=header> <div id=storeFinder> /* html
I have the following HTML. <body> <div class=header></div> <div class=navdiv></div> <div class=mainarea> <p></p> <table>

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.