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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:33:11+00:00 2026-06-11T16:33:11+00:00

I have 3 box with jquery effect and one box that created when i

  • 0

I have 3 box with jquery effect and one box that created when i click “Click to create Jquery Box”
my problem is when i create jquery box with .html() method new created box does not accept jquery effect like other html boxes

demo
http://jsfiddle.net/afshinprofe/f9s6X/

HTML

    <h2>Click to Add JQuery Box</h2>
<div class="box">Html Box 1</div>
<div class="box">Html Box 2</div>
<div class="box">Html Box 3</div>
<div id="res"></div>

CSS

   .box{
    width:50px;
    height:50px;
    background-color:gray;
    color:white;
    float:left;
    border:medium blue solid;
    margin:10px;
   }

JQuery

$("h2").click(function(){
    $("#res").html('<div class="box">JQuery Box 4</div>');
});
$(".box").hover(function () {
$(this).css("color","red");},
function(){
$(this).css("color","white");
});
  • 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-11T16:33:12+00:00Added an answer on June 11, 2026 at 4:33 pm

    If you just bind the hover event to elements of the box class it will work on the elements that are in the DOM at that moment. It’s not a live binding however. You need to use .on() for that.

    Example:

    $("body").on('mouseenter', '.box', function () {
        $(this).css("color","red");
    }).on('mouseleave', '.box', function(){
        $(this).css("color","white");
    });
    

    Fixed fiddle

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

Sidebar

Related Questions

I'm trying to learn html and jquery. My issue is that I have box
I have a select box on a page that does a post with jQuery
I have created a reiszable box using jQuery UI and I then pass the
i have one slide panel login box with jquery and its works fine only
I have autocomplete text box, that is JQuery based. when i record the macro,
I'm new to jQuery and I want to have a input box from a
I have a JQuery dialog box on a page that calls something like this:
I'm still quite new with jQuery, I know that I could google and have
We have developed a website that uses MVC, C#, and jQuery. In one of
I have a a nice jquery slide down effect working here: http://georgedesign.co.uk/test/markupV2/index.html In the

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.