We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide

document elements and mozilla

I hate google. Either too much information or not nearly enough.


Can anybody point me to where I can find the mozilla (firefox) equivalent of:-


document.getElementById("btnEmail").value="New Button Text";


Because I'm going spare trying to change the text on a button.


Please :)
Hi, I'm a Board Guide on the Old Style and the Consumer Rights boards which means I'm a volunteer to help the boards run smoothly and can move and merge posts there. Board guides are not moderators and don't read every post. If you spot an inappropriate or illegal post then please report it to forumteam@moneysavingexpert.com. It is not part of my role to deal with reportable posts. Any views are mine and are not the official line of MoneySavingExpert.
Never ascribe to malice that which is adequately explained by incompetence.
DTFAC: Y.T.D = £5.20 Apr £0.50

Comments

  • That should work. How are you creating the button though? In the following example only the button created by the <input> tag works in Firefox, whereas both buttons work in IE.
    <html>
    <head>
    <script type="text/javascript">
    function changeButton(btnId)
    !!
     document.getElementById(btnId).value="New Button Text";
    }
    </script>
    </head>
    <body>
    <button id="btnEmail" value="button tag" onClick="changeButton('btnEmail')">button tag</button>
    <input type="button" id="btnEmail2" value="input tag button" onClick="changeButton('btnEmail2')">
    </body>
    </html>
    
    In the above code change the !! to an open curly bracket.
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 353.5K Banking & Borrowing
  • 254.1K Reduce Debt & Boost Income
  • 455K Spending & Discounts
  • 246.6K Work, Benefits & Business
  • 602.9K Mortgages, Homes & Bills
  • 178.1K Life & Family
  • 260.6K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.