Javascipt Condition Statement Calling : I would like to seek for help on how to call the function CheckColour() where it perform checking on the "details" of the table. The if-else statement in CheckColour() will return the background colour of the element to "blue" when "details" is "M", else return pink (for the "F"). When I try to calling the function as shown in the code i shown, it doesnt't works. 

**JavaScript Code:**
     
    //table      
    var table = [
    "Lyn", "22", "F", 1, 1,
	"May", "32", "F", 18, 1,
	"Sam", "27", "F", 1, 2,
    "Sham", "23", "F", 2, 2,
    "Hrs", "22", "M", 13, 2
    ];

    // function calling starts here..

				for ( var i = 0; i < table.length; i += 5 ) {

					var element = document.createElement( 'div' );
					element.className = 'element';
					
					var number = document.createElement( 'div' );
					number.className = 'number';
					number.textContent = (i/5) + 1;
					element.appendChild( number );

					var symbol = document.createElement( 'div' );
					symbol.className = 'symbol';
					symbol.textContent = table[ i ];
					element.appendChild( symbol );

					var details = document.createElement( 'div' );
					details.className = 'details';
					details.innerHTML = table[ i + 1 ] + '<br>' + table[ i + 2 ];
					element.appendChild( details );
					element.CheckColour(details);  /*help me check this */
					
					/*CheckColour function, help me check this too if there is any error*/
                    function CheckColour()
                    {
                      var element, number, symbol, details;
                  
                      if(details == "M")
                      element.style.backgroundColor = 'rgba(0,191,255,0)';
                      else
                      element.style.backgroundColor = 'rgba(255,105,180,0)';
                    }

					var object = new THREE.CSS3DObject( element );
					object.position.x = Math.random() * 4000 - 2000;
					object.position.y = Math.random() * 4000 - 2000;
					object.position.z = Math.random() * 4000 - 2000;
					scene.add( object );

					objects.push( object );

					//

					var object = new THREE.Object3D();
					object.position.x = ( table[ i + 3 ] * 140 ) - 1330;
					object.position.y = - ( table[ i + 4 ] * 180 ) + 990;

					targets.table.push( object );

				}

Actually, I did the coding by referring the example from the online source (<https://threejs.org/examples/#css3d_periodictable>), in case you need any guide, can refer the link. thanks.  
