javascript getting elements with a specific class and style

Soldato
Joined
18 Oct 2002
Posts
4,925
Location
Yorkshire
Here's the deal, i've got some tables like so

Code:
<div class="holder">
<table>
	<tr>
		<td>
			<table>
				<tr>
					<td>
					</td>
				</tr>
			</table>
			<table>
				<tr>
					<td>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<table class="GroupHolder">
	<tr>
		<td>
			<table>
				<tr>
					<td>
					</td>
				</tr>
			</table>
			<table>
				<tr>
					<td>
					</td>
				</tr>
			</table>
			<table style="display:none">
				<tr>
					<td>
					</td>
				</tr>
			</table>
			<table style="display:none">
				<tr>
					<td>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</div>

Now using javascript I need to show the tables that are currently hidden i.e. display:none.

I can't alter the html structure at all or add any extra id's name's etc.

Another thing to not is that theres more html to this with input fields are are set as hidden so I can't just do a general search for the display:none and reverse it.

SO to sum up I need to walk through the table elements within the class="holder" and pick out tables that have the style="display:none" and change this style to display:block etc to show it when I click a button.

Any ideas on this was trying to do something with getting an array of all the elements that are within the class="holder" then going through the array elements and checking the attributes of the elements that are tables and if they have a style="display:none then alter its attribute.

But not sure how to do this :(
 
I've been using jQuery for the last few days. I can't, for the life of me, remember why I haven't been using it full time since forever
 
Any recommendations on how to learn it? I've had a quick look around on the Jquery site. But being a library it contains hundreds of methods and functions, so is there any specific way you'd recommend of going about it?

I'm competent in HTML & JavaScript, so I daresay that'll help!

Jon
 
I did it by thinking of some stuff that I could probably create with it, then implementing it by going through the documentation (which isn't actually as daunting as it first looks)
 
Back
Top Bottom