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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:09:30+00:00 2026-06-01T11:09:30+00:00

This is probably a dum error that can be fixed in seconds but have

  • 0

This is probably a dum error that can be fixed in seconds but have been looking for a while and dont know how to make it work

I essentially had this code
`

  <!DOCTYPE html>
   <html>
   <head>
   <style>
   .box,
   button { float:left; margin:5px 10px 5px 0; }
   .box { height:80px; width:80px; background:#090; }
   #log { clear:left; }

   </style>
     <script src="http://code.jquery.com/jquery-latest.js"></script>
   </head>
   <body>

   <button id="btn1">fade out</button>
   <button id="btn2">show</button>

   <div id="log"></div>

   <div id="box1" class="box">linear</div>
   <div id="box2" class="box">swing</div>

   <script>
   $("#btn1").click(function() {
     function complete() {
       $("<div/>").text(this.id).appendTo("#log");
     }

     $("#box1").fadeOut(1600, "linear", complete);
     $("#box2").fadeOut(1600, complete);
   });

   $("#btn2").click(function() {
    $("div").show();
     $("#log").empty();
   });

   </script>

   </body>
   </html>

`
So then I wanted to make it work in wordpress so I moved the style to a css and the to the footer.php as you can see here

`

                <?php wp_enqueue_script("jquery"); ?>
                <script>
$("#btn1").click(function() {
function complete() {
$("<div/>").text(this.id).appendTo("#log");
}

$("#box1").fadeOut(1600, "linear", complete);
$("#box2").fadeOut(1600, complete);
});

$("#btn2").click(function() {
$("#box1").show();
$("#box2").show();
$("#log").empty();
});

</script>

`

http://testdomain.edgardoroldanonline.com/testpage/

But it does not work I have placed the wp_enquenue and everything I could see as a potential problem like interference on different versions of jquery but dont know what is causing the problem the only thing I know is that one time I put the line within the pages html code and it worked. Until the visual editor got rid of 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-01T11:09:32+00:00Added an answer on June 1, 2026 at 11:09 am

    You have a javascript error.

    /testpage/:233 Uncaught TypeError: Cannot call method ‘click’ of null

    You need to initialize jQuery

    jQuery(function(){
        jQuery("#btn1").click(function() {
    
            function complete() {
              jQuery("<div/>").text(this.id).appendTo("#log");
            }
    
            jQuery("#box1").fadeOut(1600, "linear", complete);
            jQuery("#box2").fadeOut(1600, complete);
        });
    
        jQuery("#btn2").click(function() {
        jQuery("#box1").show();
        jQuery("#box2").show();
        jQuery("#log").empty();
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this probably has been asked before but I am having issues with
I have a feeling that this probably is not possible using strictly CSS, but,
I know that this probably is micro-optimization, but still I wonder if there is
This probably has been asked before but all I can find are questions regarding
This probably an obvious solution, but I've been hitting a wall for a while
I know that this probably doesn't really matter, but I would like to know
I know this probably really simple but Im not sure what im doing wrong...
I've been working all day and I somehow can't get this probably easy task
Alright this probably is the worst error I have found ever. I have two
Well this probably isn't specific to rails, but in my rails app, I have

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.