>>I'd like to write a ToggleDisplay JavaScript function. Currently I'm calling it as
>>
>>this.btnSaveProfile.Attributes["onclick"] = "ToggleDisplay('GridInfo','ProfileInfo');";
>>
>>There is no problem to write it as accepting 2 parameters. But how can I make it more generic to process any number of parameters and toggle the display?
>
>Could you pass all the items separated by a comma into one string and then process each item at the function level?
I'm not sure, but may be I can do that. In the meantime I found this
http://jeffhowden.com/code/javascript/toggle_display/which is not exactly what I need, but it seems like it's working with variable number of parameters. I'll try to adapt this code for my needs if I could figure it out.
If it's not broken, fix it until it is.
My Blog