Why do I get object required?
<div id=layer1 style="visibility:hidden; position: absolute; top: 250; left: 20; width: 550; height: 100; background-color: #FFFFFF; border: 2px dotted #6699FF; padding: 5px"></div>
var emptyDiv = "layer1";
document.getElementById(emptyDiv).style.visibility = 'visible';
document.getElementById(emptyDiv).innerHTML = xx;
I give up, why do you? I don't.
I do have to ask why you wrote
That's kind of meaningless.
.... onclick='remove("+emptyDiv+")'; ...
It surely should have been
.... onclick='remove(emptyDiv)'; ...
As your code is written, you would be callling There is no variable by that name, so when you end up doing you will either be doing the equivalent of
alert(null) or, esp. in MSIE browsers,
alert( the_object_with_the_id_of_layer1 ) (because MSIE treats IDs as object references if you don't override that meaning).
This behaviour is as far as I can see implemented in FF 15 too
Originally Posted by Old Pedant
Interesting. Didn't used to be. Wow. That's a big change.