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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:50:41+00:00 2026-06-09T13:50:41+00:00

Please help me to fix this… i have a link with the code http://jsfiddle.net/LTYa2/14/

  • 0

Please help me to fix this…

i have a link with the code http://jsfiddle.net/LTYa2/14/ its working fine in jsfiddle… but if i put the same thing in localhost its not working any specific reason?i also checked javascripts and jquery everything is embeded correctly(other jsfiddle code works fine)……

can anyone guide me on how to place this code

$('q.clickMe1').click(function () {
// find first of following DIV siblings
// with class "textBox" and toggle it

$(this).nextAll('div.sri1:first').show();
$('div.sri1:visible').not($(this).nextAll('div.sri1:first')).toggle();
});

html code

<q class="clickMe1">Hire</q>
<br />
<div class="sri1"> - This text will be toggled</div>

 <q class="clickMe1">Manage</q>
 <br />
 <div class="sri1"> - This text will be toggled 2</div>
  • 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-09T13:50:43+00:00Added an answer on June 9, 2026 at 1:50 pm

    jsFiddle is wrapping the code in onload by default that’s why it’s working. Here is fiddle where it’s not working since I disabled the onload wrapping.

    To make it work for you, wrap it like this:

    $(document).ready(function() {
        $('q.clickMe1').click(function () {
            // find first of following DIV siblings
            // with class "textBox" and toggle it
            $(this).nextAll('div.sri1:first').show();
            $('div.sri1:visible').not($(this).nextAll('div.sri1:first')).toggle();
        });
    });
    

    Assuming you are using jQuery 1.7 or above, you can avoid this wrapping and use .on() instead like this:

    $(document).on('click', 'q.clickMe1', function () {
        //...your code here
    });
    

    Updated fiddle – no onload and still working.

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

Sidebar

Related Questions

can some one please help me fix this http://jsfiddle.net/q4rdL/2/ i am doing a menu
Please help me to improve the following script: http://jsfiddle.net/n9BkM/8/ I need the following fucntionality:
Please help me fix this code!: first .m file: NSInteger MYGlobalVariable = 0; second
Can someone please help me fix this code up? I am getting some weird
Please help me fix this issue. I would like to set the width of
Please help me to fix this issue (Im getting crazy now!), My project is
I have downloaded this code; http://www.cs.sfu.ca/%7Emori/research/superpixels/superpixels64.tar.gz In the readme file, it says; Run mex
Please help me to fix the CSS error in profile on my site (IE).
Please help me somebody to convert unicodestring into string This is how i am
Please help me with this update query. I COMPLETELY understand how redundant this is

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.