How to condense onclick code to be dynamic
- by opbeta
I am trying to get this onclick function code to be dynamic. I do not want to have 50 blocks of code for all the states. He is a quick snippet of the code
var Ohio=function(){
document.getElementById('texas').style.display='none';
document.getElementById('florida').style.display='none';
document.getElementById('ohio').style.display='block';
}
and so on and so forth.....
How would I go about condensing this to make it smaller and dynamic?