<?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>a href &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/tag/a-href/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Fri, 17 Jul 2015 12:43:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>a href &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Custom Handling of a href Tag in jQuery</title>
		<link>https://sibeeshpassion.com/custom-handling-of-a-href-tag-in-jquery/</link>
					<comments>https://sibeeshpassion.com/custom-handling-of-a-href-tag-in-jquery/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 29 Mar 2015 20:13:04 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[a href]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=1471</guid>

					<description><![CDATA[Introduction Hi all. Today I came across a situation of disabling and enabling a href tag programmatically. The property enable and disable is applicable for the input elements. So what must we do? Using the code Let us say I have an a tag as follows: &#60;a href=&#8220;#&#8221; id=&#8220;btnCreate&#8221;&#62;&#60;/a&#62; Now what we will do is just add an attribute and set the value as follows. if (data.length &#62; 1000) {    $(&#8216;#btnCreateWidget&#8217;).attr(&#8216;disabled&#8217;, true); } Here (data.length &#62; 1000 ) is my condition. You can provide your own condition there. Now what do we need to think? What if the condition fails? We then must remove the attribute, right? [&#8230;]]]></description>
										<content:encoded><![CDATA[<div><strong>Introduction</strong></div>
<div></div>
<p>Hi all. Today I came across a situation of disabling and enabling a href tag programmatically. The property enable and disable is applicable for the input elements. So what must we do?</p>
<p><strong>Using the code<br />
</strong><br />
Let us say I have an a tag as follows:</p>
<div class="dp-highlighter">
<div class="bar"></div>
<ol class="dp-xml">
<li class="alt"><span class="tag">&lt;</span><span class="tag-name">a</span> <span class="attribute">href</span>=<span class="attribute-value">&#8220;#&#8221;</span> <span class="attribute">id</span>=<span class="attribute-value">&#8220;btnCreate&#8221;</span><span class="tag">&gt;</span><span class="tag">&lt;/</span><span class="tag-name">a</span><span class="tag">&gt;</span></li>
</ol>
</div>
<p>Now what we will do is just add an attribute and set the value as follows.</p>
<div class="dp-highlighter">
<div class="bar"></div>
<ol class="dp-xml">
<li class="alt">if (data.length <span class="tag">&gt;</span> 1000)</li>
<li>{</li>
<li class="alt">   $(&#8216;#btnCreateWidget&#8217;).attr(&#8216;disabled&#8217;, true);</li>
<li>}</li>
</ol>
</div>
<p>Here (data.length &gt; 1000 ) is my condition. You can provide your own condition there. Now what do we need to think? What if the condition fails? We then must remove the attribute, right?</p>
<div class="dp-highlighter">
<div class="bar"></div>
<ol class="dp-xml">
<li class="alt">else</li>
<li class="alt">{</li>
<li>   $(&#8216;#btnCreateWidget&#8217;).removeAttr(&#8216;disabled&#8217;);</li>
<li class="alt">}</li>
</ol>
</div>
<p>Now the remaining part is handling this in the click event. Are you ready?</p>
<p>Please see the following code.</p>
<div class="dp-highlighter">
<div class="bar"></div>
<ol class="dp-xml">
<li class="alt">$(&#8220;#btnCreate&#8221;).click(function (e)</li>
<li class="alt">{</li>
<li>    if ($(this).attr(&#8216;disabled&#8217;) != undefined)</li>
<li class="alt">{</li>
<li>        return ($(this).attr(&#8216;disabled&#8217;)) ? false : true;</li>
<li class="alt">}</li>
<li>    else</li>
<li class="alt">{</li>
<li>    //else condition codes here</li>
<li class="alt">}</li>
<li>}</li>
</ol>
</div>
<p>What we are doing in the preceding code is we are checking whether the attribute we added is undefined or not first. Then if the attribute value is disabled, we are returning false. In the else part we can write the necessary code.</p>
<p><strong>Conclusion<br />
</strong><br />
I hope you liked this article. Please provide your valuable suggestions.</p>
<p>Kindest Regards,</p>
<p>Sibeesh venu <a href="http://www.sibeeshpassion.com/">www.sibeeshpassion.com</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/custom-handling-of-a-href-tag-in-jquery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
