using javascript to disable link in php script
<p>Hello I am trying to disable a link in my PHP script using a JS function. I am not sure why is its not working. Any input appreciated.. </p>

<pre><code> &lt;!DOCTYPE html&gt;
 &lt;html&gt;
 &lt;head&gt;
 &lt;script type="text/javascript"&gt;

function disable() 
{   document.getElementById("perfumes_web_link").innerHTML='&lt;a href="javascript: void(0)"&gt;&lt;http://www.google.com" rel="external""&gt;Perfumes&lt;/a&gt;';    
}

function enable() 
{       document.getElementById("perfumes_web_link").innerHTML='&lt;a href="http://www.google.com" rel="external""&gt;Perfumes&lt;\/a&gt;';

}       
&lt;/script&gt;

&lt;/head&gt;

&lt;?php

$disable_link = 0 ;

echo '&lt;h1&gt;JavaScript to disable link if  set to zero&lt;/h1&gt;';
echo '&lt;li&gt;&lt;span id="perfumes_web_link"&gt;&lt;/span&gt;&lt;br&gt;'."\n";
echo '&lt;span class="perfumes_browser"&gt;&lt;small&gt;(Internet Explorer v6 or higher req.)    &lt; /small&gt;&lt;/span&gt;&lt;/li&gt;';

if ($disable_link = 1)
{echo '&lt;script type="text/javascript"&gt;disable();&lt;/script&gt;';
}
elseif ($disable_link = 0) 
{
echo '&lt;script type="text/javascript"&gt;enable();&lt;/script&gt;';
}

?&gt;
&lt;/html&gt;
</code></pre>

<p>So what am i doing wrong? Should i use if/else statement in the JS function itself or should i use true/false instead of 0 and 1.</p>

<p>Should i use something else like jQuery or Ajax..</p>

<p>Thanks   </p>
