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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:19:51+00:00 2026-06-09T00:19:51+00:00

My html code below should display a button for the colors green and red

  • 0

My html code below should display a button for the colors green and red but they are not displaying, I do however see the buttons for clear canvas and howdy. any help on what is wrong? I would ultimately like when the buttons are pushed to changed the color of the line that is beign drawn on the canvas, I fanyone knows how ti implement in Javascript code that owuld be helpful. I’m very new to this.

<title>Paint Canvas</title>
</head>
<body>
    <div id="container">
        <canvas id="imageView" width="600" height="300">
            <input type= "button" value= "Green" id= "green" onclick= "GreenRect()" />
            <input type= "button" value= "Red" id= "red" onclick= "RedRect()" />
            </p>
        </canvas>
    </div>

    <script type="text/javascript" src=".js"></script>
</body>
</html>

<body >
    <button id="clear">Clear Canvas</button><br>
    <button id="howdy">Howdy!</button><br>
</body>
  • 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-09T00:19:52+00:00Added an answer on June 9, 2026 at 12:19 am

    Your buttons should be below canvas in you code, just because canvas ignore all content within opening and closeing tags.

    You can style your buttons position to have overlayed canvas.

    Btw. you have double <body> tag in your code.

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

Sidebar

Related Questions

I'd like to retrieve the image source within the below HTML code block, but
The code below works on one page, but not another page (the place it
for example have a div,html code below <div id=testDiv></div> but when i set the
Below is the code where it is displaying the delete message but it is
I have below html code in my aspx. <input type=hidden id=medicalLink value='<a href=/forms/contactus.aspx >Contact
I have below html code in one of the opensource project. <form action=/wiki/bin/view/Main/Search> <div
I am getting a Value cannot be null error from the code below: @Html.Label(material.ExtendedGroup)
I have below code in html. <li class=selected runat=server id=lihome><a href=/ISS/home.aspx title=Home><span>Home</span></a></li> Now I
I have below is the html code for TD which gets appended after matching
Hello i have the code below <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>

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.