Firebug Does Not Show Current Value Attribute for HtmlInputElement

45 views
Skip to first unread message

James Cobban

unread,
Dec 4, 2014, 10:16:03 PM12/4/14
to fir...@googlegroups.com
I find it misleading that if I create a form element using Javascript with a particular value attribute, and then use Javascript to alter the value attribute that Firebug shows only the original value, and not the new value.  For example imagine I have the following HTML:

<p id='row'>
  <input type='text' id='Fred' name='Fred' value='Flintstone'>
</p>

And in Javascript I do:

var newinput = document.getElementById('Fred').clone(false);
newinput.id='Barney';
newinput.name='Barney';
newinput.value='Rubble';
document.getElementById('row').append(newinput);

Then Firebug displays the value attribute of the new input node as "Flintstone", not "Rubble", while it shows the id and name attributes as 'Barney'.

This is the situation where element.value is not the same as element.defaultValue.  Because of the clone operation newinput.defaultValue is "Flintstone" and newinput.value is "Rubble".  To make the Firebug display of the input element display the current value of the value attribute, I must also change the value of the defaultValue attribute so the two attributes agree.  I feel that in this situation Firebug should either display just the current value of the value attribute, which is what the external user sees in the browser, or should display the values of both the value attribute and the defaultValue attribute.

This is with Firebug 2.0.6 on Firefox 34.0 running on Ubuntu Linux.

Florent Fayolle

unread,
Dec 8, 2014, 4:49:12 PM12/8/14
to fir...@googlegroups.com
I see what you mean... But I fear displaying element.defaultValue in the tree would either clutter the UI or confuse the people. Or do you have an idea in mind?

Note that element.value is displayed in the DOM side-panel.

Florent

Sebastian Zartner

unread,
Dec 9, 2014, 7:09:48 AM12/9/14
to fir...@googlegroups.com
But I fear displaying element.defaultValue in the tree would either clutter the UI or confuse the people.
Florent means element.value. Though I agree that it would rather be confusing to have two values shown within the HTML panel. And only displaying the current value would be inconsistent as it does not reflect the HTML but a DOM property.
See also issue 4165.

Sebastian

Florent Fayolle

unread,
Dec 9, 2014, 7:25:36 AM12/9/14
to fir...@googlegroups.com
> Florent means element.value.

Oops, indeed.

Florent

--
You received this message because you are subscribed to a topic in the Google Groups "Firebug" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebug/XhV3g0eoges/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebug+u...@googlegroups.com.
To post to this group, send email to fir...@googlegroups.com.
Visit this group at http://groups.google.com/group/firebug.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebug/7d29e217-cf08-4e4a-b4b9-2187d2908447%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages