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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:57:52+00:00 2026-06-04T07:57:52+00:00

I have some content that I am show/hiding using the Jquery toggle function. I

  • 0

I have some content that I am show/hiding using the Jquery toggle function.

I have prepended an arrow to each heading and would like to change the prepended arrow to a downwards arrow when the content is toggled.

Code so far:

$(document).ready(function(){
    $('.show-hide-list h3 a').prepend('> ');//Prepend arrow
    $('.show-hide-list li .show-hide-list-content').hide();//Hide content
    $('.show-hide-list h3').click(function() {//Perform toggle when clicked
        $(this).next('.show-hide-list-content').toggle();
        //Need to change orientation of prepended arrow when toggled
        return false;
    });
});

The html is as follows:

<ul class="show-hide-list">
<li>
       <h3><a href="#">Heading</a></h3>
   <div class="show-hide-list-content">
           Content to be toggled here.
       </div>
    </li>
 </ul>

How can I change the arrow orientation once toggled?

  • 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-04T07:57:53+00:00Added an answer on June 4, 2026 at 7:57 am

    Wrap your arrow in a span tag so you can easily select it.

    $(document).ready(function(){
        $('.show-hide-list h3 a').prepend('<span>&gt;&nbsp;</span>');//Prepend arrow
        $('.show-hide-list li .show-hide-list-content').hide();//Hide content
        $('.show-hide-list h3').click(function() {//Perform toggle when clicked
            $(this).next('.show-hide-list-content').toggle();
            var arrow = $(this).find('span');
    
            if (arrow.text().indexOf('V') >= 0) {
                arrow.html('&gt;&nbsp;');  
            } else {
                arrow.html('V&nbsp;');
            }
            //Need to change orientation of prepended arrow when toggled
            return false;
        });
    }); ​
    

    http://jsfiddle.net/6DB7t/1/

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

Sidebar

Related Questions

I have some content that I am loading using jquery ajax. The content has
I have a jQuery ajax function that loads some content into a div, some
I have some JQuery code that shows or hides a div. $(div#extraControls).show(); // OR
I have build Views that show some images from nodes. I'm also using Views
I have a very basic function which I am using jQuery to slide some
I have some content that i have to render as a excel file in
I have some content that I want to appear on multiple pages of my
In silverlight 2.0. I have some content that i want to scroll vertically and
I'm doing some in browser editing, and I have some content that's on the
I have a div with some inner content that I need to have an

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.