<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linha de comando.com - Tecnologia, Informação, Dicas e muito mais. &#187; for</title>
	<atom:link href="http://www.linhadecomando.com/tag/for/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linhadecomando.com</link>
	<description>quem sabe eu possa te ajudar!</description>
	<lastBuildDate>Thu, 02 Feb 2012 09:42:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>JavaScript: Contando Checkbox Selecionados (3)</title>
		<link>http://www.linhadecomando.com/javascript/javascript-contando-checkbox-selecionados-3</link>
		<comments>http://www.linhadecomando.com/javascript/javascript-contando-checkbox-selecionados-3#comments</comments>
		<pubDate>Fri, 04 Sep 2009 13:23:24 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[checkbox]]></category>
		<category><![CDATA[for]]></category>
		<category><![CDATA[getElementsByTagName]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[inputs]]></category>
		<category><![CDATA[JavaScript checkbox]]></category>
		<category><![CDATA[resultados]]></category>
		<category><![CDATA[retorno da função]]></category>

		<guid isPermaLink="false">http://www.linhadecomando.com/?p=815</guid>
		<description><![CDATA[Parte final da nossa sequência de códigos. Resultado final: Please upgrade your browser Código completo: &#60;html&#62; &#60;head&#62; &#60;title&#62;Contando Checkbox&#60;/title&#62; &#60;script language=&#34;JavaScript&#34;&#62; &#60;!-- ***** funcao javascript ***** --&#62; function contaCheckbox&#40;selecionados&#41;&#123; var inputs, x, selecionados=0; inputs = document.getElementsByTagName&#40;'input'&#41;; for&#40;x=0;x&#60;inputs.length;x++&#41;&#123; if&#40;inputs&#91;x&#93;.type=='checkbox'&#41;&#123; if&#40;inputs&#91;x&#93;.checked==true &#38;&#38; inputs&#91;x&#93;.id == 'check'&#41;&#123; selecionados++; &#125; &#125; &#125; return selecionados; &#125; function pegaQuantidade&#40;&#41;&#123; var total; total [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-2234028370580589";
/* 468x15, criado 22/07/09 */
google_ad_slot = "1021735866";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Parte final da nossa sequência de códigos.</p>
<p><strong>Resultado final</strong>:<br />
<div class="iframe-wrapper">
  <iframe src="http://www.linhadecomando.com/javascript/conta_checkbox.html" frameborder="0" style="height:120px;width:400px;margin:0">Please upgrade your browser</iframe>
</div>
<p><strong>Código completo</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>Contando Checkbox<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;!--</span> <span style="color: #339933;">*****</span> funcao javascript <span style="color: #339933;">*****</span> <span style="color: #339933;">--&gt;</span>
<span style="color: #003366; font-weight: bold;">function</span> contaCheckbox<span style="color: #009900;">&#40;</span>selecionados<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> inputs<span style="color: #339933;">,</span> x<span style="color: #339933;">,</span> selecionados<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
  inputs <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>x<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>x<span style="color: #339933;">&lt;</span>inputs.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>x<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>inputs<span style="color: #009900;">&#91;</span>x<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">type</span><span style="color: #339933;">==</span><span style="color: #3366CC;">'checkbox'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>inputs<span style="color: #009900;">&#91;</span>x<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">checked</span><span style="color: #339933;">==</span><span style="color: #003366; font-weight: bold;">true</span> <span style="color: #339933;">&amp;&amp;</span> inputs<span style="color: #009900;">&#91;</span>x<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">id</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        selecionados<span style="color: #339933;">++;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> selecionados<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> pegaQuantidade<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> total<span style="color: #339933;">;</span> 
  total <span style="color: #339933;">=</span> contaCheckbox<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>total <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Quantidade retornada: &quot;</span> <span style="color: #339933;">+</span> total<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
  <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Selecione pelo menos um checkbox&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;!--</span> <span style="color: #339933;">*****</span> html <span style="color: #339933;">-</span> formulario <span style="color: #339933;">*****</span> <span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;</span>form<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>table<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;</span>
   <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;valor 1&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;check&quot;</span><span style="color: #339933;">&gt;</span> Checkbox <span style="color: #CC0000;">1</span><span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span> 
   <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;valor 2&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;check&quot;</span><span style="color: #339933;">&gt;</span> Checkbox <span style="color: #CC0000;">2</span><span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span> 
   <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;valor 3&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;check&quot;</span><span style="color: #339933;">&gt;</span> Checkbox <span style="color: #CC0000;">3</span><span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span>
   <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;valor 4&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;check&quot;</span><span style="color: #339933;">&gt;</span> Checkbox <span style="color: #CC0000;">4</span><span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span>
   <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;valor 5&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;check&quot;</span><span style="color: #339933;">&gt;</span> Checkbox <span style="color: #CC0000;">5</span><span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span> 
   <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;valor 6&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;check&quot;</span><span style="color: #339933;">&gt;</span> Checkbox <span style="color: #CC0000;">6</span><span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span> 
   <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;valor 7&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;check&quot;</span><span style="color: #339933;">&gt;</span> Checkbox <span style="color: #CC0000;">7</span>
  <span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>tr<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>table<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;button&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;VERIFICAR&quot;</span> onclick<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;pegaQuantidade();&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.linhadecomando.com/javascript/javascript-contando-checkbox-selecionados-3/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JavaScript: Contando Checkbox Selecionados (2)</title>
		<link>http://www.linhadecomando.com/javascript/javascript-contando-checkbox-selecionados-parte-2</link>
		<comments>http://www.linhadecomando.com/javascript/javascript-contando-checkbox-selecionados-parte-2#comments</comments>
		<pubDate>Fri, 04 Sep 2009 13:11:14 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[checkbox]]></category>
		<category><![CDATA[for]]></category>
		<category><![CDATA[getElementsByTagName]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[inputs]]></category>
		<category><![CDATA[retorno da função]]></category>

		<guid isPermaLink="false">http://www.linhadecomando.com/?p=809</guid>
		<description><![CDATA[Como prometido, vamos pegar o retorno da função e mostrar o resultado na tela. - Primeiro, vamos utilizar uma função para obter o retorno, chamado pegaQuantidade. - Segundo, inserir um botão, que ao clicar, vamos exibir na tela a quantidade de checkbox selecionados; o código deve ficar dentro das tags &#60;form&#62; &#60;/form&#62; function pegaQuantidade&#40;&#41;&#123; var [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-2234028370580589";
/* 468x15, criado 22/07/09 */
google_ad_slot = "1021735866";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Como prometido, vamos pegar o retorno da função e mostrar o resultado na tela.</p>
<p>- Primeiro, vamos utilizar uma função para obter o retorno, chamado pegaQuantidade.<br />
- Segundo, inserir um botão, que ao clicar, vamos exibir na tela a quantidade de checkbox selecionados; o código deve ficar dentro das tags &lt;form&gt; &lt;/form&gt;</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> pegaQuantidade<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> total<span style="color: #339933;">;</span> 
  total <span style="color: #339933;">=</span> contaCheckbox<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>total <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Quantidade retornada: &quot;</span> <span style="color: #339933;">+</span> total<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
  <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Selecione pelo menos um checkbox&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="html4script" style="font-family:monospace;">&lt;input type=&quot;button&quot; value=&quot;VERIFICAR&quot; onclick=&quot;pegaQuantidade();&quot; /&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.linhadecomando.com/javascript/javascript-contando-checkbox-selecionados-parte-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript: Contando Checkbox Selecionados (1)</title>
		<link>http://www.linhadecomando.com/javascript/javascript-contando-checkbox-selecionados</link>
		<comments>http://www.linhadecomando.com/javascript/javascript-contando-checkbox-selecionados#comments</comments>
		<pubDate>Fri, 04 Sep 2009 12:42:21 +0000</pubDate>
		<dc:creator>Tiago</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[checkbox]]></category>
		<category><![CDATA[for]]></category>
		<category><![CDATA[getElementsByTagName]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[inputs]]></category>

		<guid isPermaLink="false">http://www.linhadecomando.com/?p=798</guid>
		<description><![CDATA[Neste post você irá aprender, através de javascript, a contar o checkbox selecionados. Explicando o código: - função contaCheckbox obtém todos os inputs (checkbox) em forma de array e atribui a variável inputs. - dentro do for foram utilizados alguns if para filtrar a nossa busca; lembrando que queremos contar os checkbox selecionados. - o [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-2234028370580589";
/* 468x15, criado 22/07/09 */
google_ad_slot = "1021735866";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Neste post você irá aprender, através de javascript, a contar o checkbox selecionados.</p>
<p><strong>Explicando o código</strong>:</p>
<p>- função <strong>contaCheckbox</strong> obtém todos os inputs (checkbox) em forma de array e atribui a variável inputs.<br />
- dentro do for foram utilizados alguns if para filtrar a nossa busca; lembrando que queremos contar os checkbox selecionados.<br />
- o primeiro if verifica se os inputs são do tipo checkbox, pode ser aplicado aos demais inputs.<br />
- o segundo if verifica se o checkbox está selecionado e <em>id</em> é igual a &#8220;check&#8221;; o id é utilizado aqui para diferenciar de outros checkbox, quero dizer, se você tem vários checkbox, no mesmo formulário, separados por assunto.<br />
- <strong>selecionados++</strong> é o incrementador; quando passar por esta linha acrescentamos ao total de selecionados o valor de 1.</p>
<p><em>Este post está dividido em 3 partes, na segunda parte, acrescentaremos alguns códigos para pegarmos o retorno da função e ao clicar num botão será exibido um alerta com a quantidade de checbox selecionados</em>; a terceira parte, será disponibilizado o código completo e o resultado final para testar online.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>Contando Checkbox<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;!--</span> <span style="color: #339933;">*****</span> funcao javascript <span style="color: #339933;">*****</span> <span style="color: #339933;">--&gt;</span>
<span style="color: #003366; font-weight: bold;">function</span> contaCheckbox<span style="color: #009900;">&#40;</span>selecionados<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> inputs<span style="color: #339933;">,</span> x<span style="color: #339933;">,</span> selecionados<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
  inputs <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>x<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>x<span style="color: #339933;">&lt;</span>inputs.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>x<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>inputs<span style="color: #009900;">&#91;</span>x<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">type</span><span style="color: #339933;">==</span><span style="color: #3366CC;">'checkbox'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>inputs<span style="color: #009900;">&#91;</span>x<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">checked</span><span style="color: #339933;">==</span><span style="color: #003366; font-weight: bold;">true</span> <span style="color: #339933;">&amp;&amp;</span> inputs<span style="color: #009900;">&#91;</span>x<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">id</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'check'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        selecionados<span style="color: #339933;">++;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> selecionados<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;!--</span> <span style="color: #339933;">*****</span> html <span style="color: #339933;">-</span> formulario <span style="color: #339933;">*****</span> <span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;</span>form<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>table<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;</span>
   <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;valor 1&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;check&quot;</span><span style="color: #339933;">&gt;</span> Checkbox <span style="color: #CC0000;">1</span><span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span> 
   <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;valor 2&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;check&quot;</span><span style="color: #339933;">&gt;</span> Checkbox <span style="color: #CC0000;">2</span><span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span> 
   <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;valor 3&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;check&quot;</span><span style="color: #339933;">&gt;</span> Checkbox <span style="color: #CC0000;">3</span><span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span>
   <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;valor 4&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;check&quot;</span><span style="color: #339933;">&gt;</span> Checkbox <span style="color: #CC0000;">4</span><span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span>
   <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;valor 5&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;check&quot;</span><span style="color: #339933;">&gt;</span> Checkbox <span style="color: #CC0000;">5</span><span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span> 
   <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;valor 6&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;check&quot;</span><span style="color: #339933;">&gt;</span> Checkbox <span style="color: #CC0000;">6</span><span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span> 
   <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;valor 7&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;check&quot;</span><span style="color: #339933;">&gt;</span> Checkbox <span style="color: #CC0000;">7</span>
  <span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>tr<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>table<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.linhadecomando.com/javascript/javascript-contando-checkbox-selecionados/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

