<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Disable All Links Within DIV</title>
	<atom:link href="http://www.dalesandro.net/2009/12/14/disable-all-links-within-div/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dalesandro.net/2009/12/14/disable-all-links-within-div/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=disable-all-links-within-div</link>
	<description>...because someone already has dot com</description>
	<lastBuildDate>Thu, 12 Jan 2012 23:30:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: sm</title>
		<link>http://www.dalesandro.net/2009/12/14/disable-all-links-within-div/comment-page-1/#comment-102</link>
		<dc:creator>sm</dc:creator>
		<pubDate>Sat, 24 Dec 2011 19:41:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.dalesandro.net/?p=681#comment-102</guid>
		<description>and please help me user when point on any link the link url will not display at bottom of the window.</description>
		<content:encoded><![CDATA[<p>and please help me user when point on any link the link url will not display at bottom of the window.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sm</title>
		<link>http://www.dalesandro.net/2009/12/14/disable-all-links-within-div/comment-page-1/#comment-101</link>
		<dc:creator>sm</dc:creator>
		<pubDate>Sat, 24 Dec 2011 19:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.dalesandro.net/?p=681#comment-101</guid>
		<description>nice post but some time in internet explorer button click event works</description>
		<content:encoded><![CDATA[<p>nice post but some time in internet explorer button click event works</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Dalesandro</title>
		<link>http://www.dalesandro.net/2009/12/14/disable-all-links-within-div/comment-page-1/#comment-97</link>
		<dc:creator>John Dalesandro</dc:creator>
		<pubDate>Thu, 23 Jun 2011 20:40:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.dalesandro.net/?p=681#comment-97</guid>
		<description>In response to the comment, here is a modified version and a corresponding function to re-enable the links. Please note the creation of a new attribute for each link that acts as a backup to store the original link.

&lt;pre lang=&quot;javascript&quot;&gt;
      function DisableAllDIVLinks(DivId) {
        var div = document.getElementById(DivId);
        var anchorList = div.getElementsByTagName(&#039;a&#039;);

        for(var i = 0; i &lt; anchorList.length; i++) {
          anchorList[i].disabled = true;
          anchorList[i].setAttribute(&#039;backup_href&#039;,
                  anchorList[i].getAttribute(&quot;href&quot;));
          anchorList[i].removeAttribute(&#039;href&#039;);
        }
      }

      function EnableAllDIVLinks(DivId) {
        var div = document.getElementById(DivId);
        var anchorList = div.getElementsByTagName(&#039;a&#039;);

        for(var i = 0; i &lt; anchorList.length; i++) {
          anchorList[i].disabled = false;
          anchorList[i].setAttribute(&#039;href&#039;,
                  anchorList[i].getAttribute(&quot;backup_href&quot;));
          anchorList[i].removeAttribute(&#039;backup_href&#039;);
        }
      }
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>In response to the comment, here is a modified version and a corresponding function to re-enable the links. Please note the creation of a new attribute for each link that acts as a backup to store the original link.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">      <span style="color: #003366; font-weight: bold;">function</span> DisableAllDIVLinks<span style="color: #009900;">&#40;</span>DivId<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>DivId<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> anchorList <span style="color: #339933;">=</span> div.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> anchorList.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">disabled</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
          anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'backup_href'</span><span style="color: #339933;">,</span>
                  anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">removeAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #003366; font-weight: bold;">function</span> EnableAllDIVLinks<span style="color: #009900;">&#40;</span>DivId<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> div <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>DivId<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> anchorList <span style="color: #339933;">=</span> div.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> anchorList.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">disabled</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
          anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #339933;">,</span>
                  anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;backup_href&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">removeAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'backup_href'</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>

]]></content:encoded>
	</item>
	<item>
		<title>By: Soumya</title>
		<link>http://www.dalesandro.net/2009/12/14/disable-all-links-within-div/comment-page-1/#comment-96</link>
		<dc:creator>Soumya</dc:creator>
		<pubDate>Thu, 23 Jun 2011 13:10:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.dalesandro.net/?p=681#comment-96</guid>
		<description>Hi,

First of all I want to thank you for the piece of code you mentioned here.
It&#039;s working fine. the links are getting disable in a div when I click on a particular button.
But again on clicking on another button I want the links to be activated again.

I tried on the same code you given here.

function EnableAllDIVLinks(DivId)
{
  var div = document.getElementById(DivId);
  var anchorList = div.getElementsByTagName(&#039;a&#039;);
  
  for(var i = 0; i &lt; anchorList.length; i++)
  {
    anchorList[i].enabled = true;
    anchorList[i].setAttribute(&#039;href&#039;);

  }
}

Doing this links ar getting activated but showing &#039;undefined&#039;

Can you please help me with some tips. It&#039;s very urgent.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>First of all I want to thank you for the piece of code you mentioned here.<br />
It&#8217;s working fine. the links are getting disable in a div when I click on a particular button.<br />
But again on clicking on another button I want the links to be activated again.</p>
<p>I tried on the same code you given here.</p>
<p>function EnableAllDIVLinks(DivId)<br />
{<br />
  var div = document.getElementById(DivId);<br />
  var anchorList = div.getElementsByTagName(&#8216;a&#8217;);</p>
<p>  for(var i = 0; i &lt; anchorList.length; i++)<br />
  {<br />
    anchorList[i].enabled = true;<br />
    anchorList[i].setAttribute(&#039;href&#039;);</p>
<p>  }<br />
}</p>
<p>Doing this links ar getting activated but showing &#039;undefined&#039;</p>
<p>Can you please help me with some tips. It&#039;s very urgent.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

