Very new to Javascript and trying to run before I can walk but I am trying to use a javascript routine to change styling dynamically - I have a number of <Div> with generated IDs pix1, pix2 pix3 etc and images with an onclick function example hidepix(1), hidepix(2) etc. I am trying to write a function that that takes the value, generates a variable and applies styling to that Div
function hidepix(x){
}
But it isn't working - any ideas?
So, in other words, how do I dymanically create a variable that I can apply a style to?
function hidepix(x){
var px="pix"+x;
px.style.display="none";}
But it isn't working - any ideas?
So, in other words, how do I dymanically create a variable that I can apply a style to?