views:

78

answers:

1

i have the following div structure with respective ids :

<div id="border_1" class="track_mc01302 track_01_mc01302">
    <img id="_img" />
    <div id="border"></div>
</div>

but when i click on the parent div an error is encountered which says : setting a property that has only a getter

i have written listener for keyboard press events(direction keys)

the following function is called when i hit enter from keyboard :

function jsfunc() {         
    var elem = document.getElementByID(currpos_html);
    for(var i=0;i<elem.childNodes.length;i++){
        if(elem.childNodes[i].id == "_img") elem.childNodes[i].style="block";
        if(elem.childNodes[i].id == "border") {
            elem.childNodes[i].style.display="block";
        }
}
A: 

Unless this :

elem.childNodes[i].style="block";

is a transcription typo it may be your problem, you cannot set style to a string AFAIK.

In the next line you have

elem.childNodes[i].style.display="block"

which is more reasonable

Hans B PUFAL