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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:55:40+00:00 2026-06-10T10:55:40+00:00

Trying to build a FAQ page using jQuery. This is the js I’m working

  • 0

Trying to build a FAQ page using jQuery. This is the js I’m working with:

$("#faq li").click(function (event) {
    event.preventDefault(); 
    $(this).next("#faq li ul").slideToggle("fast");
});

Not sure why it isn’t working, any help is appreciated.

Here is the HTML:

<ul id="faq">

<li>Where are you located?
<ul>
We are located in Southern Cali!
</ul>
</li>

<li>What are your service times?
<ul>
Our service times are 7:00, 8:00, and 9:00!
</ul>
</li>

</ul>
  • 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-10T10:55:41+00:00Added an answer on June 10, 2026 at 10:55 am

    A <li> must always be a child of a <ul>, and a <ul> can contain nothing else. That latter point means that your markup is invalid.

    You should perhaps use a <dl> (definition list) instead and then use <dt> for the item titles and <dd> for the item text. That would be the sort of list intended exactly for this use case:

    <dl id="faq">
    <dt>Where are you located?</dt>
    <dd>We are located in Southern Cali!</dd>
    <dt>What are your service times?</dt>
    <dd>Our service times are 7:00, 8:00, and 9:00!</dd>
    </dl>
    

    with code as follows (using event delegation)

    $("#faq dt").click(function() {
       $(this).next('dd').slideToggle('fast');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build an FAQ page. The page will have 2 columns: first
In my rails application I'm trying to build a simple FAQ page that has
Trying to build a tree structure with knockout and jquery mobile. using a listview
I am trying to build a simple FAQ page with answers that slideDown and
I'm trying build this network connection using BroadcastReceiver. When connection doesnt exist it will
I am trying build a page, where a user can login using his google
I am trying build a jQuery EasyUI datagrid or treegrid out of a large
Trying to build openssl-fips-2.0 with NDK, before I was lucky found this link and
I am trying build a DataTable one row at a time using the following
Trying to build dynamic output from json and using jq/template tmpl display rows/columns. Somehow

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.