<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="0.91">
    <channel>
        <title>Change visibility by class</title>
        <description>The 10 most recently added comments in the topic &quot;Change visibility by class&quot;</description>
        <link>http://www.freewaytalk.net/</link>
        <lastBuildDate>Sat, 04 Feb 2012 10:56:54 -500</lastBuildDate>
        <generator>FeedCreator 1.7.2</generator>
        <item>
            <title>Re: Change visibility by class</title>
            <link>http://www.freewaytalk.net/thread/view/65672#m_65676</link>
            <description>&lt;p&gt;In Prototype, there is the double-dollar function, which will return
an array (always an array) of elements that match whatever CSS3
selector you can cook up.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$$('div.foo') //--&amp;gt; returns an array of divs with the classname 'foo'
$$('input[type=&quot;checkbox&quot;][checked=&quot;checked&quot;]') //--&amp;gt;returns an array
of checked checkboxes
$$('p:first-child') //--&amp;gt; returns an array of paragraphs that are the
first child of their nearest parent
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Since these elements have been &amp;#8220;extended&amp;#8221; by Prototype, you have
access to the rich library of iterators and &amp;#8220;finders&amp;#8221; that allow you
to further tweak your results, or you can apply the same method to all
of them at once using invoke() as in:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$$('p.hideMe').invoke('hide');
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you&amp;#8217;re not using Prototype, then there is the standard
getElementsBySelector(), but you may have to do some serious testing
to make sure that IE understands what you mean. The good folks at
Prototype have already done that work for you and bottled it up so
it&amp;#8217;s more accessible and you don&amp;#8217;t have to repeat yourself.&lt;/p&gt;

&lt;p&gt;Walter&lt;/p&gt;

&lt;p&gt;On Feb 18, 2010, at 3:35 PM, David Ledger wrote:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Is there a JavaScript method similar to getElementById(&amp;#8220;id&amp;#8221;) that
  returns an array of elememts in a CSS class?&lt;/p&gt;
  
  &lt;p&gt;Or better still, an onClick way of dynamically changing a style
  property of all elements with a CSS class?&lt;/p&gt;
  
  &lt;p&gt;David&lt;/p&gt;
  
  &lt;p&gt;&amp;#8212; 
  David Ledger - Freelance Unix Sysadmin in the UK.
  HP-UX specialist of hpUG technical user group (www.hpug.org.uk)
  email@hidden
  www.ivdcs.co.uk&lt;/p&gt;
  
  &lt;hr /&gt;
  
  &lt;p&gt;dynamo mailing list
  email@hidden
  Update your subscriptions at:
  &lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;p&gt;dynamo mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>waltd</author>
            <pubDate>Thu, 18 Feb 2010 21:48:19 -500</pubDate>
        </item>
        <item>
            <title>Change visibility by class</title>
            <link>http://www.freewaytalk.net/thread/view/65672</link>
            <description>&lt;p&gt;Is there a JavaScript method similar to getElementById(&amp;#8220;id&amp;#8221;) that 
returns an array of elememts in a CSS class?&lt;/p&gt;

&lt;p&gt;Or better still, an onClick way of dynamically changing a style 
property of all elements with a CSS class?&lt;/p&gt;

&lt;p&gt;David&lt;/p&gt;

&lt;p&gt;David Ledger - Freelance Unix Sysadmin in the UK.
HP-UX specialist of hpUG technical user group (www.hpug.org.uk)
email@hidden
www.ivdcs.co.uk&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;dynamo mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>David Ledger</author>
            <pubDate>Thu, 18 Feb 2010 20:35:32 -500</pubDate>
        </item>
    </channel>
</rss>

