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

  • Home
  • SEARCH
  • 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 560935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:23:48+00:00 2026-05-13T12:23:48+00:00

I use too much jquery I want to do this with out jquery: <a

  • 0

I use too much jquery

I want to do this with out jquery:

<a onclick="javascript:$(this).next().css('display', 'none')">

I thought it was this:

<a onclick="javascript:this.nextSibling.style.display = 'none'">

But its not. Style returns undefined.

Let me clarify:

I want to do this:

<a class="errorToggle">error</a>
<div style="padding-left:20px;margin:0 0 10px 0;display:none;">

<h4>A PHP Error was encountered</h4>

<p>Severity: <?php echo $severity; ?></p>
<p>Message:  <?php echo $message; ?></p>
<p>Filename: <?php echo $filepath; ?></p>
<p>Line Number: <?php echo $line; ?></p>

</div>

<script type="text/javascript">
  $(".errorToggle").click(function(){
    $(this).next().css("display", "block");
  });
</script>

Without jQuery BECAUSE this is a code igniter error view file that quite often will load before my header does, so I will not have access to jquery. It doesn’t need to be pretty, or well coded, just work. This will not be used in production.

  • 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-05-13T12:23:49+00:00Added an answer on May 13, 2026 at 12:23 pm

    Take a look at this article:
    JavaScript nextSibling and Cross Browser Compatibility

    Excerpt:

    The problem was that we were
    referencing the ‘nextSibling’ of an
    element in our JS using the onClick
    event. In IE this worked great,
    however in Firefox the ‘nextSibling’
    could be a line break.

    You might want to iterate through the “nextSibling()” until you hit what you want.

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

Sidebar

Related Questions

Since the TFS is too big for our project, we want to use subversion
I'm tearing my hair out on this one; I want / need / would
I would like to know what are some downsides using too much JavaScript code
I am coming from the .net world where too much use of the Forms
I want to use a temp directory that will be unique to this build.
My current online shop use PayPal express checkout (for credit card too) to charge
I'm a VMware user and far too often I use keyboard shortcuts while programming.
Duplicate of: When/Why to use Cascading in SQL Server? I've always been too scared
I'm trying to use jquery to create a tab effect for several div contents.
Possible Duplicate: c++ using too much cpu my game uses over 50% of cpu.

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.