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

  • Home
  • SEARCH
  • 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 7825885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:11:36+00:00 2026-06-02T09:11:36+00:00

How do I change the value of this button? I am looking at a

  • 0

How do I change the value of this button? I am looking at a tutorial, but only the url seems to change, and not the button.

<form name="form" id="form">
<button name="button" id="button">Click Me!</button>
</form>

<script type="text/javascript">
document.form.button.value=new Date();
</script>
  • 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-02T09:11:37+00:00Added an answer on June 2, 2026 at 9:11 am

    I added an onclick to your button to change the value with the function.

    If you add onsubmit="return false" to the form tag, it won’t refresh the page.

    <form name="form" id="form" onsubmit="return false">
        <button name="button" id="button" onclick="changeValue();" value="before" >Click Me!</button>
    </form>
    
    <script type="text/javascript">
        function changeValue()
        {
            // Changes the value of the button
            document.form.button.value = new Date();
    
            // Changes the text on the button
            document.form.button.innerHTML = new Date();
        }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my JavaScript code: <script> function change(name){ var element = document.all.name.value; } </script>
I'm trying to execute this function when a select list's (LevelId0) value change but
I should send data with form when submit button pressed.This value should be invisible
How change int value in block, I have this : __block long long size
I have a TextBox and I change it's Left value. And this TextBox is
I am looking for a way to change the value what I passed to
Pretty new here. But before I ask my question, I'm not looking for teh
I have a form and a button. I need that when I click on
I asked this question previously: Disabling and Re-Enabling Dynamic Form Elements with JQuery but
I'm trying to update/change contact ringtone using this code: ContentValues values = new ContentValues();

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.