In my HTML code, I have a button that, when clicked, launches a javascript function. This is the HTML code for the button:
<button type="button" onclick="repeatName()">Click me!</button>
I want the user to enter something into the text box (which is inside the form). This is the code for the text field:
<input type="text" name="txtName" />
I want this innerHTML div to change according to the information placed in the name text box after the button is clicked. This is the code for the div:
<div name="editThis" width="50px" height="50px" border="1px"> </div>
When the button is pressed, I want it to launch the function below. It is supposed to change innerHTML div.
function repeatName() { var editField = document.getElementsByName("editThis").innerHTML; var repeatedName = document.theForm.txtName.value; editField = (repeatedName + " is the value.") }
PROBLEM: every time a button is clicked, I see this error in the Firefox error console:
Error: uncaught exception: [Exception... "Cannot modify properties of a WrappedNative" nsresult: "0x80570034 (NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN)" location: "JS frame :: chrome://global/content/bindings/autocomplete.xml :: onxblpopuphiding :: line 825" data: no]
What is this error and how to fix it?
source share