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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:11:52+00:00 2026-06-17T09:11:52+00:00

EDIT: I have fixed the semi-colons, the case sensitivity, as well as the brackets.

  • 0

EDIT: I have fixed the semi-colons, the case sensitivity, as well as the brackets. The code WORKS if I remove the functions after buttonPARTICULAR! Why?

EDIT: Fixed. I’m a dumbass. Sorry!!! :-Z

When I keep it simple, like this, everything works fine:

  <head>
  <script>

     function buttonGRUPO()
     {
         document.getElementById("desc").innerHTML="Grupo";
     }
     function buttonPARTICULAR()
     {
         document.getElementById("desc").innerHTML="Particular";
     }

 </script>
 </head>
 <body>

    <p>&nbsp;<button class="art-button" onclick="buttonPARTICULAR()">Aulas Particulares</button></p>
    <p>&nbsp;<button class="art-button" onclick="buttonGRUPO()">Aulas em Grupo</button></p>
  <p id="desc">Text</p>
 </body>

However, whenever I add more functions to the script, ALL of the buttons and code stop working.

 <head>
 <script>

function buttonGRUPO()
{
    document.getElementById("desc").innerHTML="Grupo";
}
function buttonPARTICULAR()
{
    document.getElementById("desc").innerHTML="Particular";
}
function buttonINCOMPANY()
{
    document.getElementbyID("desc").innerHTML="in-COmpany";
}
function buttonINTENSIVOS()
}
    document.getElementbyID("desc").innerHTML="Intensivo";
{
function buttonIMERSIVOS()
}
    document.getElementbyID("desc").innerHTML="Imersivos"
{
function buttonPALESTRAS()
}
    document.getElementbyID("desc").innerHTML="Palestras"
}
</script>
</head> 
<body>
 <p>&nbsp;<button class="art-button" onclick="buttonPARTICULAR()">Aulas Particulares</button></p>
 <p>&nbsp;<button class="art-button" onclick="buttonGRUPO()">Aulas em Grupo</button>  </p>
 <p id="desc">Text</p>
 </body>

How is it that augmenting the quantity of virtually identical code will disrupt even the code that, before, was functional? Am I committing a syntax error here?

EDIT

@Woot4Moot Still not functional

still not functional.

function buttonB()
 {
document.getElementById("desc").innerHTML="B";
}
function buttonA()
{
document.getElementById("desc").innerHTML="A";
}
function buttonC()
{
document.getElementbyID("desc").innerHTML="C";
}
function buttonD()
{
document.getElementbyID("desc").innerHTML="D";
}
function buttonE()
{
document.getElementbyID("desc").innerHTML="E";
}
function buttonF()
{
 document.getElementbyID("desc").innerHTML="F";
}

<p><button onclick="buttonA()">A</button></p>
    <p><button onclick="buttonB()">B</button></p>
<p id="desc"> text</p>'

To be more specific, when I load this code into my browser (the buttons and p id="desc") but when the buttons are clicked on, the p id="desc" does not change according to the JavaScript command.

  • 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-17T09:11:53+00:00Added an answer on June 17, 2026 at 9:11 am

    Besides the syntax errors:

    function buttonINTENSIVOS()
    }
    document.getElementbyID("desc").innerHTML="Intensivo"
    {
    function buttonIMERSIVOS()
    }
    document.getElementbyID("desc").innerHTML="Imersivos"
    {
    function buttonPALESTRAS()
    }
    

    Your braces are the wrong way. Functions open with { not } and you dont have semicolons ; to terminate each command

    What you want is this:

    function buttonINTENSIVOS()
      {
        document.getElementbyId("desc").innerHTML="Intensivo";
      }
    function buttonIMERSIVOS()
    {
          document.getElementbyId("desc").innerHTML="Imersivos";
    }
    function buttonPALESTRAS()
    {  ... }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: I have fully fixed my code now. Here it is: #include <stdio.h> #include
* edit have fixed this code - see inline comments marked EDIT * I'm
EDIT: I have fixed all but two warnings now, so thank you all for
I have an edit text which functions as a search box in my application.
Edit: After addressing some issues that may or may not have been causing problems,
I have fixed an icon in the place using jQuery $('#edit').css({left: 512}); When i
i have fixed height and width of the edit text. When i start typing
EDIT Due to the overwhelming amount of advice I have received, I have fixed
It looks like in edit and add forms all field have fixed width. I
EDIT : As of 2012-06-11 this bug has been finally fixed! https://bugs.webkit.org/show_bug.cgi?id=35981#c1 I have

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.