I have dynmically created several id values for some div elements that I want to show and hide.
I am using the following script to show and hide.
I am using an OnClick event to show my elements. However, as I show one div tag I want to hide all other div tags. Because I have dynamically created the "id" values for the div tags, I'd like to use a single "hide command" when using the OnClick. Here is my current OnClick code.
I'd like to use a common code for hiding all div tags.
Here's my question. Can I use a wildcard character as a catch all. For instance, can I do something like this.
Where the * is a wildcard that will hide all elements starting with "addressid".
I am using the following script to show and hide.
Code:
/* Shows address details */
function ShowAddress18(addressid18) {
document.getElementById('addressid18').style.display = "block";
}
/* Hides address details */
function HideAddress18(addressid18) {
document.getElementById('addressid18').style.display = "none";
}
Code:
onClick="HideAddress65('addressid65'),
HideAddress66('addressid66'),
ShowAddress17('addressid17')"
Here's my question. Can I use a wildcard character as a catch all. For instance, can I do something like this.
Code:
Onclick="HideAddress*('addressid*'),ShowAddress17('addressed17')"
Where the * is a wildcard that will hide all elements starting with "addressid".