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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:36:08+00:00 2026-05-27T03:36:08+00:00

I have included a file named test.php in the file index.php lets assume index.php

  • 0

I have included a file named test.php in the file index.php

lets assume index.php is like this

<html>
<head>
</head>
<body>
<h1 id="dash">Index</h1>

<div id='tab.php'>

<?php include('tab.php'); ?>


</div>
</body>
</html>

and tab.php is like this

<html>
<head>
</head>
<body>
<ul>

<li id='date' onClick="change_head(this.id);">Dates</li>

<li id='appoint' onClick="change_head(this.id);">Appointments</li>

<ul>
</body>
</html>

Here what i would like to do is, if the list item date is clicked(list items are actually tabs). The inner html of the h1 tag with id dash should be changed to Dates and if the list item appoint is clicked the inner html of same h1 tag with id dash should change to appointments.

how can i do that ?? i tried the usual javascript way by taking the ids and applying the if condition to change the innerHTML but it was not working..anyone pls help me how to do it

JAVASCRIPT (this is the js i tried to achive it…i added this in index.php)

    function change_head(id){

    dash = document.getElementById('dash').innerHTML;

    if(id == date){

    dash = "Date";


    }
    else if(id == appoint){

    dash = "Appointment";

    }
    else{
    dash = "Index";
    }

}
  • 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-27T03:36:09+00:00Added an answer on May 27, 2026 at 3:36 am

    You could try using jquery… something like this:

    <script type="text/javascript">
    
    $(document).ready(function () {
        $("li#date").click(function () {
            $("h1#dash").val("Dates");
        });
        $("li#appoint").click(function () {
            $("h1#dash").val("Appointments");
        });
    });
    
    </script>
    

    Of course, if you had more of these tabs, I would create a single click event handler for all “li” elements and switch on the ID 🙂

    Assuming you’re new to jquery, you’d also have to include the jquery script in your page. Something like:

    <script src="/Scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
    

    Check out jquery.com to get started.

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

Sidebar

Related Questions

I have a file called header.html and it is included by base.html . In
I have a header file, lets say Common.h, that is included in all of
I've never seen anything like this. File structure: somefolder/base.php includes/stuff.php includes/constants.php base.php: <?php require(../includes/stuff.php);
I have a .htaccess in my that has this line: RewriteRule ^name/([^/]+)$ login/test.php?test=$1 So
I have a PHP file with a mix of html, text and php includes
I have a php file named config.php in which I defined the application settings
I have a problem with a simple included file. The file being included is
I need to echo entire content of included file. I have tried the below:
I have a file that I want to include in Python but the included
I have a non-.Net executable file that is included in my .net assembly as

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.