I wanted to know if anyone else has experienced this ‘glitch’ between browsers with javascript.
My javascript was the following
var theForm = document.getElementById( 'theForm' );
theForm.firstname = theForm.firstName.value.trim();
theForm.lastname = theForm.lastName.value.trim();
theForm.firstName.style.color = "red";
This doesn’t seem to be working in Opera 11 but it works in Firefox 4.
I just think that the two javascript engines are handling things differently.
When I debug the javascript in both I get different results to.
In Opera, theForm.firstName turns into a regular old string after assignment but in Firefox it stays a form element.
Has anyone else experienced this?
How is a browser supposed to know whether form[“someName”] is a property or a DOM element inside the form if you shadow it.
Garbage in, Garbage out.