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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:17:09+00:00 2026-06-13T10:17:09+00:00

I have this code $(td).hover(function(){ $(this).find(‘a.btn’).show(); }, function(){ $(this).find(‘a.btn’).hide(); }) How can i convert

  • 0

I have this code

$("td").hover(function(){
                $(this).find('a.btn').show();
                }, function(){
                $(this).find('a.btn').hide();
            })

How can i convert this function for new dom elements with on

  • 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-13T10:17:11+00:00Added an answer on June 13, 2026 at 10:17 am
    $("#mytable").on('hover', 'td', function(){
        $(this).find('a.btn').show();
        }, function(){
        $(this).find('a.btn').hide();
    });
    

    But using the 'hover' pseudo event as a substitute for passing 'mouseenter mouseleave' is deprecated, so you should really use mouseenter and mouseleave directly.

    $("#mytable").on('mouseenter', 'td', function(){
        $(this).find('a.btn').show();
    })
    .on('mouseleave', 'td', function(){
        $(this).find('a.btn').hide();
    });
    

    Or like this:

    $("#mytable").on({'mouseenter': function(){
        $(this).find('a.btn').show();
    }, 'mouseleave': function(){
        $(this).find('a.btn').hide();
    }}, 'td');
    

    Or shorter like this:

    $("#mytable").on('mouseenter mouseleave', 'td', function(e){
        $(this).find('a.btn').toggle(e.type === 'mouseenter');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: $(document).ready(function(){ $(.yearInner).hide(); $(.year, this).hover( function () { $(.yearInner, this).slideToggle();
I have weird problem with this code $('img').hover(function(){ var $cap = $(this).parent().find('.cap'); window.setTimeout(function(){$cap.stop(true,false).animate({bottom:164},500)},500); },function(){
I have this code: $('.ui-datepicker-calendar tr').live('mouseleave', function() { $(this).find('td a').removeClass('ui-state-hover'); }); This affects all
I have this code somewhere in my plugin: $('tr', $this).hover(function(){ var cur_color = null;
If I have a chunk of code like this: .hover( function () { hoverState($(#navbar
I have this code, but it execute only once... $('.' + container).hover(function() { t
I have this little code: $(ul#mainnav > li).hover(function(){ $(ul#mainnav > li > a).slideUp(); })
I have the following code: $(#myDiv).hover( function () { $(this).clearQueue().animate({ backgroundColor: #d7df23, opacity: 0.95
I have the following code: $('a.uiPopup').hover(function () { $('.uiTip').show(); }, function () { $('.uiTip').remove();
Alright, so I have some code hurr: $(document).ready(function(){ $(div.post.photo img).hover(function () { $(div.show).slideToggle(fast); });

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.