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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:35:09+00:00 2026-05-30T15:35:09+00:00

im making a todo list app in php and im using unordered lists to

  • 0

im making a todo list app in php and im using unordered lists to print them out.What I want is to display the titles of todo lists to be displayed first and their contents hidden initially but displayed later via the click event in jQuery.This is what i have tried so far…

<?php 
include_once "connect_to_mysql.php";
$name = $_POST['name'];
$todo = $_POST['todo'];
$sql = mysql_query("INSERT INTO todo (todo,name) 
 VALUES('$todo','$name')")  
 or die (mysql_error());
 $sql2 = mysql_query("SELECT DISTINCT name FROM todo");
$todofeed .= ' <ul id = "nav">';         
while($row = mysql_fetch_array($sql2))
{
$name1 = $row["name"];
$todofeed.='<li class="title"><a href="#">' . $name1 . '</a></li>';

$sql3 = mysql_query("SELECT id, todo FROM todo WHERE name='$name1' ");
while($row = mysql_fetch_array($sql3))
{$todo1 = $row["todo"];

    $todofeed.='<ul>
    <li id="items">' . $todo1 . '</li>
</ul>';}}
    $todofeed .= '</ul>';     
     print "$todofeed";

    ?>
    <style type="text/css">

  li#items
    {
   display:none;
  }
     </style>
      <script src="http://code.jquery.com/jquery-latest.js"></script>
      <script type="text/javascript">
$(document).ready(function() {


$('ul#nav li#title').click(function() {
 $('li#items').css('display' , 'visible');
});
});
       </script>

any way to fix this?

  • 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-30T15:35:10+00:00Added an answer on May 30, 2026 at 3:35 pm
    $('ul#nav li.title').click(function() {
    

    because of your

    $todofeed.='<li class="title"><a href="#">' . $name1 . '</a></li>';

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

Sidebar

Related Questions

I'm making a todo list program using windows forms for one of my university
I'm making a simple web app with PhotoSwipe to display lots of images. How
I'm making a todo list in django. I have a model with some properties:
I'm making a Jeopardy board in HTML/JavaScript/XML. I want this app to be able
I feel like I'm doing something dumb here. I'm making a simple TODO list
I am making a app where part of it is a list of the
I'm making a product review service using Google App Engine, and I'm wondering about
I'm making a Cocoa application and I can't figure out how to do something.
I have a UITableView and basically I'm making some in app settings, and if
I am a newbie at Blackberry development. I am making an app which I

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.