Question : Object Oriented Javascript Question

Hi, I'm trying to figure out how to modify the property of an object
from within an object descended from that parent object. Here's the
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
//new object 
function A() { 
        this.first = "one"; 
        this.second = "two"; 
        this.third = "three"; 
} 

//add the 'typing' object to our object 
A.prototype.myType = { 
        firstType : function() { 
        }, 
        secondType : function() { 
                //how do I alter the value of function A's "second" property from 
here? 
                // 'this' is scoped to the current object 
        }, 
        thirdType : function() { 
        } 
} 

B = new A(); 
var typeIt = "secondType"; 
if (typeIt in B.myType) { 
        B.myType['typeIt']; 
} 


I want to change the value of A.second (well, once I invoke it as "B",
it will be B.second) to be something other than "two." The 'this'
keyword within A.myType references the myType object. How do I
reference this instance of A, however?
Thanks, in advance.

Answer : Object Oriented Javascript Question

you can set visibility through style

document.getElementById('idofelement').style.display("none"); //hide element
document.getElementById('idofelement').style.display(""); //display element

css display will make the element invisible and also hide it from the page so elements will shift as if the element you hid was gone from the page

document.getElementById('idofelement').style.visibility("hidden"); //hide element
document.getElementById('idofelement').style.visibility("visible"); //display element

css visibility will make the item invisible, but it will still hold it's place on the page

for example if you had 3 images, and you used css display property to hide the middle image, the third image would move to be next to the first image, as if there was no 2nd image there. If you used visibility to hide the middle image, then the middle image would disappear and it would look like there was an empty space the size of the middle picture between pictures 1 and 3
Random Solutions  
 
programming4us programming4us