danscan
12-18-2003, 03:54 PM
This is a rather generic Question. A newbie to Javascript but not to programming.
If I have multiple Classes of DIV each with multiple Elements
<div class=CarPic id=Car1>
<Div class=CarPic ID=Car2>
<div class=petpic ID=pet1>
<div class=petpic ID=pet2>
I want to press one button which passes a classname to a function that would make visible all of its class but Hide every other class.
<span onclick="ShowME('Carpic')"> Show Car</span>
<span onclick="ShowME('petPic')">Show Pet</span>
Do I need to preload everything into an Array maybe premake an array with all of classes?
How do I pass a classname so its recognized as a class name?
How can I access all of the elements of that class?
OR Can I make a style change to a class and have it cascade that style change to all of the classes elements?
If I have multiple Classes of DIV each with multiple Elements
<div class=CarPic id=Car1>
<Div class=CarPic ID=Car2>
<div class=petpic ID=pet1>
<div class=petpic ID=pet2>
I want to press one button which passes a classname to a function that would make visible all of its class but Hide every other class.
<span onclick="ShowME('Carpic')"> Show Car</span>
<span onclick="ShowME('petPic')">Show Pet</span>
Do I need to preload everything into an Array maybe premake an array with all of classes?
How do I pass a classname so its recognized as a class name?
How can I access all of the elements of that class?
OR Can I make a style change to a class and have it cascade that style change to all of the classes elements?