<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7148860988886047724</atom:id><lastBuildDate>Mon, 27 Feb 2012 09:30:27 +0000</lastBuildDate><category>jQuery For Beginners</category><category>jQuery UI DatePicker</category><category>jQuery 1.7</category><category>Text Editor Plugins</category><category>jQuery Selectors</category><category>jQuery With Ajax</category><category>DropDown</category><category>jQuery docs</category><category>jQuery UI</category><category>jQuery Tutorials</category><category>jQuery CDN</category><category>jQuery Mobile Examples</category><category>ASP.NET</category><category>jQuery Codes</category><category>jQuery Array</category><category>Android Devices</category><category>jQuery Slider</category><category>Selectors</category><category>jQuery Mobile Demo</category><category>jQuery 1.6</category><category>jQuery Plugins</category><category>jQuery Text Editor</category><category>jQuery With ASP.NET</category><category>jQuery Validation</category><category>Sencha Touch</category><category>jQuery innerText</category><category>jQuery Methods</category><category>jQuery Ajax</category><category>Downloads</category><category>Jquery Code Snippets</category><category>jQuery Books</category><category>jQuery YouTube</category><category>Android</category><category>setTimeOut</category><category>Cheat Sheets</category><category>jQuery Interview Question</category><category>jQuery Tips</category><category>jQuery Properties</category><category>Ebooks</category><category>jQuery</category><category>jQuery DatePicker</category><category>CSS Selectors</category><category>CSS</category><category>GridView</category><category>jQuery Mobile</category><category>jQuery Cheat Sheets</category><category>jQuery documentation</category><category>jQuery Code Examples</category><category>jQTouch</category><category>Date Picker</category><category>jQuery Effects</category><category>jQuery Tools</category><category>Methods</category><category>Validation</category><category>HTML</category><category>ASP.NET Grid View</category><category>JavaScript</category><category>jQuery Events</category><category>Text Editor</category><category>jQuery Functions</category><title>jQuery By Example</title><description /><link>http://jquerybyexample.blogspot.com/</link><managingEditor>noreply@blogger.com (Virendra Dugar)</managingEditor><generator>Blogger</generator><openSearch:totalResults>223</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/JqueryByExample" /><feedburner:info uri="jquerybyexample" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>JqueryByExample</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-8031086282598025850</guid><pubDate>Mon, 27 Feb 2012 05:00:00 +0000</pubDate><atom:updated>2012-02-27T10:30:07.973+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Jquery Code Snippets</category><category domain="http://www.blogger.com/atom/ns#">jQuery Array</category><category domain="http://www.blogger.com/atom/ns#">jQuery Tips</category><category domain="http://www.blogger.com/atom/ns#">jQuery Codes</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><category domain="http://www.blogger.com/atom/ns#">jQuery Code Examples</category><title>How to combine/join arrays using jQuery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;In this post, we will see that "&lt;b&gt;how to join or combine arrays using jQuery&lt;/b&gt;". Below jQuery code joins the two arrays using jQuery.&lt;br /&gt;
&lt;pre class="brush:javascript;"&gt;$(document).ready(function() {
  var arrFirst = [50, 10, 19, 22];
  var arrSecond = [6, 74]; 
  $('#firstPart').html(arrFirst.join());
  $('#secondPart').html(arrSecond.join());
  var arrJoin = arrFirst.concat(arrSecond);
  $('#allElements').html(arrJoin.join());
});​
&lt;/pre&gt;&lt;br /&gt;
In this jQuery code, I have used the concat() method. contact() is the method of an array object and it is invoked on the first array and the second array is passed to it as a parameter. And it returns another array which is combination of both the arrays elements.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;See result below.&lt;/b&gt;&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/XfsFf/embedded/result,js,html" style="height: 335px; width: 100%;"&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-8031086282598025850?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/iqEI-NFPmtA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/iqEI-NFPmtA/how-to-combinejoin-arrays-using-jquery.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/how-to-combinejoin-arrays-using-jquery.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-3264895395651774664</guid><pubDate>Mon, 27 Feb 2012 04:00:00 +0000</pubDate><atom:updated>2012-02-27T09:47:52.786+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Jquery Code Snippets</category><category domain="http://www.blogger.com/atom/ns#">jQuery Array</category><category domain="http://www.blogger.com/atom/ns#">jQuery Tips</category><category domain="http://www.blogger.com/atom/ns#">jQuery Codes</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><category domain="http://www.blogger.com/atom/ns#">jQuery Code Examples</category><title>How to split an array using jQuery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
In this post, we will see that "&lt;b&gt;how to split an array using jQuery&lt;/b&gt;". Below jQuery code splits the array using jQuery.&lt;br /&gt;
&lt;pre class="brush:javascript;"&gt;$(document).ready(function()
{
  var members = [50, 10, 19, 22, 6, 74];
  $('#allElements').html(members.join());
  memsecond = members.splice(0,4);
  $('#firstPart').html(memsecond.join());
  $('#secondPart').html(members.join());
});​
&lt;/pre&gt;
In this jQuery code, I have used the &lt;b&gt;splice()&lt;/b&gt; method for splitting the array. This method requires 2 parameters. The first parameter specifies the index location from where to start splitting, and the second parameter specifies the number of elements to be removed from the original array. The range of array elements defined by the two parameters will be extracted from the original array and will be returned so it can be saved in another array.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;See result below.&lt;/b&gt;&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/VgteM/embedded/result,js,html" style="height: 335px; width: 100%;"&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;br /&gt;
Read more about splice() method &lt;a href="http://www.w3schools.com/jsref/jsref_splice.asp" target="_blank"&gt;&lt;b&gt;here&lt;/b&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;
Also read &lt;b&gt;&lt;a href="http://jquerybyexample.blogspot.in/2010/06/split-function-in-jquery.html" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Split function in jQuery&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-3264895395651774664?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/0HvtowlFN3Y" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/0HvtowlFN3Y/how-to-split-array-using-jquery.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/how-to-split-array-using-jquery.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-7215654672329844832</guid><pubDate>Wed, 22 Feb 2012 03:30:00 +0000</pubDate><atom:updated>2012-02-26T12:37:06.853+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery Array</category><category domain="http://www.blogger.com/atom/ns#">jQuery Tips</category><category domain="http://www.blogger.com/atom/ns#">jQuery Codes</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><category domain="http://www.blogger.com/atom/ns#">jQuery For Beginners</category><category domain="http://www.blogger.com/atom/ns#">jQuery Code Examples</category><title>Remove Item from Array using jQuery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
Today during my work, I came across a situation where I need to &lt;b&gt;remove items from Array using jQuery&lt;/b&gt;. I did it using &lt;b&gt;jQuery &lt;/b&gt;and thought of sharing with my you as well. Below code will remove the item from the array by its value (not by index).  &lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function(){
    var arr = ["jQuery","JavaScript","HTML","Ajax","Css"];
    var itemtoRemove = "HTML";
    arr.splice($.inArray(itemtoRemove, arr),1);
});​
&lt;/pre&gt;The above code is using JavaScript &lt;b&gt;splice()&lt;/b&gt; method and &lt;b&gt;jQuery.inArray()&lt;/b&gt; to find out index of the element. The &lt;b&gt;splice()&lt;/b&gt; method adds and/or removes elements to/from an array, and returns the removed element(s) where &lt;b&gt;jQuery.inArray()&lt;/b&gt; Search for a specified value within an array and return its index (or -1 if not found).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;See result below.&lt;/b&gt;  &lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/5Upec/embedded/result,js,html" style="height: 170px; width: 100%;"&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;br /&gt;
And if you want to remove the items from Array by index only then you don't have to use jQuery.inArray to find the index. You can directly use splice() method and pass the index of the element.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function(){
    var arr = ["jQuery","JavaScript","HTML","Ajax","Css"];
    var itemtoRemove = "HTML";
    arr.splice(1,1);
});​
&lt;/pre&gt;The second argument in splice() denotes number of items to be removed. If set to 0, no elements will be removed. If you use &lt;b&gt;&lt;i&gt;arr.splice(1,2)&lt;/i&gt;&lt;/b&gt; then it will remove 2 items from the array which are at index 1.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;See result below.&lt;/b&gt;  &lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/SmLzq/embedded/result,js,html" style="height: 140px; width: 100%;"&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;br /&gt;
You can also use splice() method to add items in array. Read more about splice() method &lt;a href="http://www.w3schools.com/jsref/jsref_splice.asp" target="_blank"&gt;&lt;b&gt;here&lt;/b&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-7215654672329844832?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/cVexMmk2e7E" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/cVexMmk2e7E/remove-item-from-array-using-jquery.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/remove-item-from-array-using-jquery.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-6605305671801074459</guid><pubDate>Tue, 21 Feb 2012 05:30:00 +0000</pubDate><atom:updated>2012-02-27T15:00:27.498+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Android Devices</category><category domain="http://www.blogger.com/atom/ns#">Android</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><title>Detect Android Devices/Phone using jQuery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
&lt;b&gt;Android &lt;/b&gt;and &lt;b&gt;iPhone/iPad&lt;/b&gt; development is pretty hot and very much in demand. Below small piece of code will be useful to &lt;b&gt;detect android devices (i.e. Android Phones &amp; Android tablets) using jQuery&lt;/b&gt;.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function(){
  var isAndroid = navigator.userAgent.toLowerCase().indexOf("android");
  if(isAndroid &amp;gt; -1)
  {
      //It is an Android device. Redirect to Android Version.
  }      
});​
&lt;/pre&gt;You can test this code by changing the user agent in your browser and set it to Android. There are many plugins/ extension available that allows to change User agent. Below is the link for various user agent switchers available with chrome and firefox. &lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;a href="https://chrome.google.com/webstore/search/user%20agent%20switcher?_ac=1" target="_blank"&gt;&lt;b&gt;For Chrome&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/search/?q=user+agent&amp;amp;appver=10.0.2&amp;amp;platform=windows" target="_blank"&gt;&lt;b&gt;For FireFox&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;Also read:&lt;/b&gt;&lt;br /&gt;
&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 16px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;&lt;b&gt;&lt;a href="http://jquerybyexample.blogspot.in/2012/02/detect-apple-devices-ipad-iphone-ipod.html" target="_blank"&gt;&lt;span style="color: #660000;"&gt;Detect Apple Devices (iPad, iPhone, iPod) using jQuery &lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-6605305671801074459?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/PkSLvhV9_eo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/PkSLvhV9_eo/detect-android-devices-using-jquery.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/detect-android-devices-using-jquery.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-1407719954892752396</guid><pubDate>Tue, 21 Feb 2012 04:05:00 +0000</pubDate><atom:updated>2012-02-21T11:40:48.573+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery</category><title>Detect Apple Devices (iPad, iPhone, iPod) using jQuery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
iPhone/iPad development is pretty hot and very much in demand. Below small piece of code will be useful to detect apple devices like iPhone, iPad and iPod using jQuery.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function(){

  var isiPhone = navigator.userAgent.toLowerCase().indexOf("iphone");
  var isiPad = navigator.userAgent.toLowerCase().indexOf("ipad");
  var isiPod = navigator.userAgent.toLowerCase().indexOf("ipod");

  if(isiPhone &amp;gt; -1)
  {
      //Redirect to iPhone Version of the website.
  }
  if(isiPad &amp;gt; -1)
  {
      //Redirect to iPad Version of the website.
  }
  if(isiPod &amp;gt; -1)
  {
      //Redirect to iPod Version of the website.
  }    
});​
&lt;/pre&gt;&lt;br /&gt;
You can test this code by changing the user agent in your browser and set it to iPhone, iPad or iPod. There are many plugins/ extension available that allows to change User agent. Below is the link for various user agent switchers available with chrome and firefox. &lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;a href="https://chrome.google.com/webstore/search/user%20agent%20switcher?_ac=1" target="_blank"&gt;&lt;b&gt;For Chrome&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/search/?q=user+agent&amp;amp;appver=10.0.2&amp;amp;platform=windows" target="_blank"&gt;&lt;b&gt;For FireFox&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
If you just want to detect whether the device used is one of out of these 3 then you can create a function which will return true, if the devices is one of them otherwise false.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;function isAppleDevice(){
    return (
        (navigator.userAgent.toLowerCase().indexOf("ipad") &gt; -1) ||
        (navigator.userAgent.toLowerCase().indexOf("iphone") &gt; -1) ||
        (navigator.userAgent.toLowerCase().indexOf("ipod") &gt; -1)
    );
}
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;Also read:&lt;/b&gt;&lt;br /&gt;
&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 16px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;&lt;b&gt;&lt;a href="http://jquerybyexample.blogspot.in/2012/02/detect-android-devices-using-jquery.html" target="_blank"&gt;&lt;span style="color: #660000;"&gt;Detect Android Devices using jQuery&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-1407719954892752396?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/oLXzfO-dkIM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/oLXzfO-dkIM/detect-apple-devices-ipad-iphone-ipod.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/detect-apple-devices-ipad-iphone-ipod.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-5550470068377943594</guid><pubDate>Mon, 20 Feb 2012 04:00:00 +0000</pubDate><atom:updated>2012-02-20T09:30:00.349+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery Tips</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><category domain="http://www.blogger.com/atom/ns#">jQuery For Beginners</category><category domain="http://www.blogger.com/atom/ns#">jQuery Code Examples</category><title>How to write IE Version specific jQuery code</title><description>Well, making code &lt;b&gt;browser&lt;/b&gt; compatible is always a challenge and presence of various browsers makes life difficult for developers. In this post, you will find the way to code for &lt;b&gt;IE&lt;/b&gt; specific version. jQuery provides &lt;b&gt;.browser&lt;/b&gt; property which returns the browser information. Below jQuery code checks for IE version 7 only.&lt;br /&gt;
&lt;pre class='brush:javascript'&gt;$(document).ready(function(){
  if(jQuery.browser.msie &amp;&amp; jQuery.browser.version.substring(0, 1) == 7)
  {
      //Your Code Goes Here...
  }
});​
&lt;/pre&gt;The above code first checks if the browser is IE or not using "&lt;b&gt;&lt;i&gt;jQuery.browser.msie&lt;/i&gt;&lt;/b&gt;". This will return true for IE and false for other browsers. And after that it checks for the version of the browser.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;See result below. (Please check in IE only)&lt;/b&gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;iframe style="width: 100%; height: 100px" src="http://jsfiddle.net/jquerybyexample/wa827/1/embedded/result,js" allowfullscreen="allowfullscreen" frameborder="1"&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;br /&gt;
You can also check for IE 8 or 9. All you need to change is the value in the if condition. Currently it is checking only for IE 7. So for IE 8,&lt;br /&gt;
&lt;pre class='brush:javascript'&gt;$(document).ready(function(){
  if(jQuery.browser.msie &amp;&amp; jQuery.browser.version.substring(0, 1) == 8)
  {
      //Your Code Goes Here...
  }
});​
&lt;/pre&gt;If you want to run the code for IE 7 or higher version of IE, then just change the condition a little bit. See below.&lt;br /&gt;
&lt;pre class='brush:javascript'&gt;$(document).ready(function(){
  if(jQuery.browser.msie &amp;&amp; jQuery.browser.version.substring(0, 1) &gt;= 7)
  {
      //Your Code Goes Here...
  }
});​
&lt;/pre&gt;&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-5550470068377943594?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/9mibkGP8pMo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/9mibkGP8pMo/how-to-write-ie-version-specific-jquery.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/how-to-write-ie-version-specific-jquery.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-8893786858328345288</guid><pubDate>Wed, 15 Feb 2012 04:30:00 +0000</pubDate><atom:updated>2012-02-15T10:09:07.602+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Jquery Code Snippets</category><category domain="http://www.blogger.com/atom/ns#">jQuery Tips</category><category domain="http://www.blogger.com/atom/ns#">jQuery Codes</category><category domain="http://www.blogger.com/atom/ns#">DropDown</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><category domain="http://www.blogger.com/atom/ns#">jQuery Code Examples</category><title>Common Dropdown operation (Get, Set, Add, Remove) using jQuery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
&lt;b&gt;DropDown&lt;/b&gt; list is a very basic and common control and You might be using either &lt;b&gt;ASP.NET Dropdown&lt;/b&gt; list or normal html &lt;b&gt;dropdown &lt;/b&gt;list in your project. In this post, I have put together the code examples for all kind of &lt;b&gt;dropdown&lt;/b&gt; operation. For example, to &lt;b&gt;get selected value from dropdown&lt;/b&gt;, for &lt;b&gt;to set value in dropdown&lt;/b&gt;, for to &lt;b&gt;add items to dropdown&lt;/b&gt;, for to &lt;b&gt;remove items from dropdown&lt;/b&gt; and to &lt;b&gt;enable/disable&lt;/b&gt; items in &lt;b&gt;dropdown&lt;/b&gt; using jQuery. These little code snippets related to all kind of dropdown operation are quite useful.&lt;br /&gt;
&lt;br /&gt;
I have summarized the code snippets under different sections which are given below.&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;a href="#get"&gt;Get value and text from dropdown list&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;b&gt;
&lt;li&gt;&lt;a href="#set"&gt;Set value and selected index in dropdown list&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#add"&gt;Add Items to dropdown list&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#remove"&gt;Remove Items from dropdown list&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#enable"&gt;Enable/Disable items in dropdown list&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#change"&gt;Selection Change Event&lt;/a&gt;&lt;/li&gt;
&lt;/b&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;span style="color: #990000; font-size: large;"&gt;&lt;b&gt;&lt;u&gt;&lt;a href="#" name="get"&gt;Get value and text from dropdown list&lt;/a&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Get selected option value&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$('#ddlList').val()
&lt;/pre&gt;&lt;b&gt;Get selected option text&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$('#ddlList option:selected').text()
&lt;/pre&gt;&lt;b&gt;Get dropdown list text&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$('#ddlList').text()
&lt;/pre&gt;&lt;b&gt;Get selected index&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$("#ddlList").get(0).selectedIndex;
&lt;/pre&gt;&lt;b&gt;Select first element&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$("#ddlList option:first-child").attr("selected","selected");
&lt;/pre&gt;&lt;span style="color: purple;"&gt;&lt;b&gt;DEMO:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/7MZLk/embedded/result,js,html" style="height: 200px; width: 100%;"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;&lt;span style="color: #990000; font-size: large;"&gt;&lt;a href="#" name="set"&gt;Set value and selected index&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Set selected index&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$("#ddlList").get(0).selectedIndex = 3;
&lt;/pre&gt;&lt;b&gt;Set element by Value&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$("#ddlList").val(5);
&lt;/pre&gt;&lt;b&gt;Set element by Text&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$('#ddlList option:contains("HTML")').attr("selected","selected");
&lt;/pre&gt;&lt;span style="color: purple;"&gt;&lt;b&gt;DEMO:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/5rjCh/embedded/result,js,html" style="height: 150px; width: 100%;"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color: #990000; font-size: large;"&gt;&lt;u&gt;&lt;a href="#" name="add"&gt;Add Items to dropdown list&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Add item to list in the begining&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$("#ddlList").prepend("&lt;option selected="selected" value="0"&gt; Select &lt;/option&gt;");
&lt;/pre&gt;&lt;b&gt;Add item to list in the end&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$("&lt;option value="6"&gt;Java Script&lt;/option&gt;").appendTo("#ddlList");
&lt;/pre&gt;&lt;span style="color: purple;"&gt;&lt;b&gt;DEMO:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/VtJz4/embedded/result,js,html" style="height: 150px; width: 100%;"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style="color: #990000; font-size: large;"&gt;&lt;a href="#" name="remove"&gt;Remove Items from dropdown list&lt;/a&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Remove selected item&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$('#ddlList option:selected').remove();
&lt;/pre&gt;&lt;b&gt;Remove Item by Value&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$('#ddlList option[value="4"]').remove();
//This removes items with value 4.
&lt;/pre&gt;&lt;b&gt;Remove Item by Text&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$('#ddlList option:contains("HTML")').remove();
//This removes items with Text HTML.
&lt;/pre&gt;&lt;b&gt;Remove all items excluding first item&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$('#ddlList option:not(:first)').remove();
&lt;/pre&gt;&lt;b&gt;Remove all items excluding last item&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$('#ddlList option:not(:last)').remove();
&lt;/pre&gt;&lt;b&gt;Clear/Empty drop down&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$("#ddlList").empty();
//OR
$("#ddlList &amp;gt; option").remove();
&lt;/pre&gt;&lt;span style="color: purple;"&gt;&lt;b&gt;DEMO:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/b2xtQ/embedded/result,js,html" style="height: 320px; width: 100%;"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #990000; font-size: large;"&gt;&lt;b&gt;&lt;u&gt;&lt;a href="#" name="enable"&gt;Enable/Disable items in dropdown list&lt;/a&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Disable item by value in dropdown list&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$("#ddlList option[value='3']").attr("disabled","disabled");
//This disables item with value 3.
&lt;/pre&gt;&lt;b&gt;Disable item by text in dropdown list&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$('#ddlList option:contains("HTML")').attr("disabled","disabled");
//This disables item with text "HTML".
&lt;/pre&gt;&lt;b&gt;Enable item by value in dropdown list&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$("#ddlList option[value='3']").removeAttr("disabled");
//This enables item with value 3.
&lt;/pre&gt;&lt;b&gt;Enable item by text in dropdown list&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$('#ddlList option:contains("HTML")').removeAttr("disabled");
//This enables item with text "HTML".
&lt;/pre&gt;&lt;span style="color: purple;"&gt;&lt;b&gt;DEMO:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/cmNrs/embedded/result,js,html" style="height: 200px; width: 100%;"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #990000; font-size: large;"&gt;&lt;b&gt;&lt;u&gt;&lt;a href="#" name="change"&gt;Selection Change Event&lt;/a&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$("#ddlList ").change(function()
{
   /* do something here */
});
&lt;/pre&gt;&lt;span style="color: purple;"&gt;&lt;b&gt;DEMO:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/ZUujX/embedded/result,js,html" style="height: 100px; width: 100%;"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
Hope you have find it useful.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-8893786858328345288?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/G-wsyEXZXBM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/G-wsyEXZXBM/common-dropdown-operation-get-set-add.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/common-dropdown-operation-get-set-add.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-8381831872441449283</guid><pubDate>Tue, 14 Feb 2012 04:00:00 +0000</pubDate><atom:updated>2012-02-14T09:30:02.430+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Jquery Code Snippets</category><category domain="http://www.blogger.com/atom/ns#">jQuery Tips</category><category domain="http://www.blogger.com/atom/ns#">jQuery Codes</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><category domain="http://www.blogger.com/atom/ns#">jQuery Code Examples</category><title>Get Radio Button value using jQuery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Here’s small piece of code to get the value of a checked or selected radio button out of a group of radio buttons.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;var selValue = $('input[name=rbnNumber]:checked').val(); 
&lt;/pre&gt;In above code, rbnNumber is name of the radio group.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color: #990000; font-size: large;"&gt;Demo&lt;/span&gt;&lt;/b&gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;HTML Code:&lt;/b&gt;&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/6Sx6n/embedded/html,result" style="height: 170px; width: 100%;"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;jQuery Code:&lt;/b&gt;&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/6Sx6n/embedded/js,result" style="height: 150px; width: 100%;"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Result:&lt;/b&gt;&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/6Sx6n/embedded/result" style="height: 180px; width: 100%;"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See Complete &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/6Sx6n/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;You can also get the value of individual radio button using it's ID as selector.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;var selValue = $('#rbnNumber:checked').val(); 
&lt;/pre&gt;If you want to get ID of selected radio button out of group of radio button, then below code will work.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;var selValue = $('input[name=rbnNumber]:checked').attr('id'); 
&lt;/pre&gt;&lt;b&gt;See Result, jQuery and HTML code below:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/2Sswn/embedded/js,result,html" style="height: 180px; width: 100%;"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-8381831872441449283?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/6E_R8u0T6LM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/6E_R8u0T6LM/get-radio-button-value-using-jquery.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/get-radio-button-value-using-jquery.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-9216073907603241039</guid><pubDate>Mon, 13 Feb 2012 05:00:00 +0000</pubDate><atom:updated>2012-02-13T10:30:00.072+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery Text Editor</category><category domain="http://www.blogger.com/atom/ns#">Text Editor</category><category domain="http://www.blogger.com/atom/ns#">Text Editor Plugins</category><category domain="http://www.blogger.com/atom/ns#">jQuery Plugins</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><title>Useful jQuery Text Editor Plugins</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
&lt;b&gt;Text editors&lt;/b&gt; allow users to edit and enter text within a web browser. Rich-text editors are essentially web-based WYSIWYG ("what you see is what you get") editors. In this post, I have put together a collection of some of the best, useful and free &lt;b&gt;jQuery Text Editor plugins&lt;/b&gt; which are very user friendly and can be easily integrated with minor modifications. These plugins are developed using jQuery.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color: purple; font-size: x-large;"&gt;&lt;a href="http://markitup.jaysalvat.com/home/" rel="nofollow"&gt;markitup&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
( &lt;b&gt;&lt;a href="http://markitup.jaysalvat.com/home/"&gt;&lt;span style="color: #990000;"&gt;Demo&lt;/span&gt;&lt;/a&gt; &lt;/b&gt;| &lt;a href="http://markitup.jaysalvat.com/downloads/"&gt;&lt;span style="color: #990000;"&gt;&lt;b&gt;Download&lt;/b&gt; &lt;/span&gt;&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
markItUp! is not meant to be a “Full-Features-Out-of-the-Box”-editor. Instead it is a very lightweight, customizable and flexible engine made to meet the developer’s needs in their CMSes, blogs, forums or websites. markItUp! is not a WYSIWYG editor, and it never will be. &lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;Fast and unobtrusive integration&lt;/li&gt;
&lt;li&gt;Support for keyboard shortcuts&lt;/li&gt;
&lt;li&gt;Ajax dynamic preview&lt;/li&gt;
&lt;li&gt;Supported: IE7, Safari 3.1, Firefox 2, Firefox 3. IE6 and Opera 9+ as-is.&lt;/li&gt;
&lt;li&gt;Licence: MIT/GPL&lt;/li&gt;
&lt;li&gt;File: Packed naked engine is about 6.5Kb.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class="separator" style="border: 1px solid grey; clear: both; text-align: center;"&gt;&lt;a href="http://markitup.jaysalvat.com/home/" imageanchor="1"&gt;&lt;img border="0" height="160" src="http://2.bp.blogspot.com/-LMyrT4uTiBM/TzYfFr-6vzI/AAAAAAAABsY/F5W4gH8tPVM/s640/jQuery+TextEditor+(MarkItUp).gif" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;hr style="border: 1px solid grey;" /&gt;&lt;br /&gt;
&lt;b&gt;&lt;a href="http://www.wymeditor.org/"&gt;&lt;span style="color: purple; font-size: x-large;"&gt;WYMEditor&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
( &lt;b&gt;&lt;a href="http://www.wymeditor.org/demo/"&gt;&lt;span style="color: #990000;"&gt;Demo&lt;/span&gt;&lt;/a&gt; &lt;/b&gt;| &lt;a href="http://www.wymeditor.org/download/"&gt;&lt;span style="color: #990000;"&gt;&lt;b&gt;Download&lt;/b&gt;&lt;/span&gt; &lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
WYMeditor is a web-based WYSIWYM (What You See Is What You Mean) XHTML editor (not WYSIWYG). WYMeditor's main concept is to leave details of the document's visual layout, and to concentrate on its structure and meaning, while trying to give the user as much comfort as possible (at least as WYSIWYG editors).&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;XHTML strict + CSS compliant&lt;/li&gt;
&lt;li&gt;No font or text formatting, sizes or colors - WYMeditor is CSS-based&lt;/li&gt;
&lt;li&gt;Designed to be easy to integrate into your application&lt;/li&gt;
&lt;li&gt;No installation needed - this is 100% Javascript code - no plugin, no extension&lt;/li&gt;
&lt;li&gt;Will remain as simple as possible&lt;/li&gt;
&lt;li&gt;We focus on well-tested code, stability and usability before adding new features&lt;/li&gt;
&lt;li&gt;Image, link, table support&lt;/li&gt;
&lt;li&gt;Skins support via CSS&lt;/li&gt;
&lt;li&gt;Internationalization&lt;/li&gt;
&lt;li&gt;APIs, plugins support&lt;/li&gt;
&lt;li&gt;Free and Open Source, fully adaptable to your needs.&lt;/li&gt;
&lt;li&gt;Most of the browsers are supported.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class="separator" style="border: 1px solid grey; clear: both; text-align: center;"&gt;&lt;a href="http://www.wymeditor.org/" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="160" src="http://1.bp.blogspot.com/-_sDRiBoZN-I/TzYtCkbD4lI/AAAAAAAABtA/z0uTZUabwoI/s640/jQuery+TextEditor+(WYMEditor).gif" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;hr style="border: 1px solid grey;" /&gt;&lt;br /&gt;
&lt;b&gt;&lt;a href="http://www.upian.com/upiansource/ueditor/en"&gt;&lt;span style="color: purple; font-size: x-large;"&gt;uEditor&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
( &lt;b&gt;&lt;a href="http://www.upian.com/upiansource/ueditor/demo/"&gt;&lt;span style="color: #990000;"&gt;Demo&lt;/span&gt;&lt;/a&gt; &lt;/b&gt;| &lt;a href="http://www.upian.com/upiansource/ueditor/files/uEditor.zip"&gt;&lt;b&gt;&lt;span style="color: #990000;"&gt;Download&lt;/span&gt;&lt;/b&gt;&lt;/a&gt; )&lt;br /&gt;
&lt;br /&gt;
uEditor is flexible and easy to use. As for widgEditor, the generated code is clean and valid (though you should verify it after form submission) and it's possible to use a custom sylesheet for rendering in WYSIWYG mode among other things.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="border: 1px solid grey; clear: both; text-align: center;"&gt;&lt;a href="http://www.upian.com/upiansource/ueditor/en" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-OSZ87tb9DMU/TzYg7sHyhJI/AAAAAAAABs4/YekJolWLprY/s1600/jQuery+TextEditor+(uEditor).png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;hr style="border: 1px solid grey;" /&gt;&lt;br /&gt;
&lt;b&gt;&lt;a href="http://remiya.com/htmlbox/"&gt;&lt;span style="color: purple; font-size: x-large;"&gt;HTMLBox&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
( &lt;b&gt;&lt;a href="http://remiya.com/htmlbox/index.php/3/demo.html"&gt;&lt;span style="color: #990000;"&gt;Demo&lt;/span&gt;&lt;/a&gt; &lt;/b&gt;| &lt;b&gt;&lt;a href="http://remiya.com/htmlbox/index.php/2/download.html"&gt;&lt;span style="color: #990000;"&gt;Download&lt;/span&gt;&lt;/a&gt;&lt;/b&gt; )&lt;br /&gt;
&lt;br /&gt;
JQuery HtmlBox is a modern, cross­browser, interactive, open­source wysiwyg editor built on top of the excellent JQuery library. It is tested with the most widely deployed browsers ­ Mozilla Firefox, SeaMonkey, Microsoft Internet Explorer, Opera, Apple Safari and Google Chrome. The variety of features, and the advanced configuration capabilities, combined with the easy and intuitive setup make HtmlBox as the preferred choice, when interactive user input is required such as in content management systems, forums, guest books, contact forms and others.&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;Easy Integration.&lt;/li&gt;
&lt;li&gt;Multiple Browser Support.&lt;/li&gt;
&lt;li&gt;Small Size.&lt;/li&gt;
&lt;li&gt;XHTML Output Possible.&lt;/li&gt;
&lt;li&gt;Ajax Support Out of the Box&lt;/li&gt;
&lt;li&gt;Complete User Manual&lt;/li&gt;
&lt;li&gt;Skinnable Interface&lt;/li&gt;
&lt;li&gt;Custom Icon Sets&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class="separator" style="border: 1px solid grey; clear: both; text-align: center;"&gt;&lt;a href="http://remiya.com/htmlbox/" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="160" src="http://3.bp.blogspot.com/-zILbowMVhac/TzYg4v_CKhI/AAAAAAAABsg/nGG6xD9Vpq8/s640/jQuery+TextEditor+%2528HTMLBox%2529.gif" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;hr style="border: 1px solid grey;" /&gt;&lt;br /&gt;
&lt;b&gt;&lt;a href="http://batiste.dosimple.ch/blog/posts/2007-09-11-1/rich-text-editor-jquery.html"&gt;&lt;span style="color: purple; font-size: x-large;"&gt;Lightweight RTE- jQuery&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
( &lt;b&gt;&lt;a href="http://batiste.dosimple.ch/blog/posts/2007-09-11-1/rich-text-editor-jquery.html"&gt;&lt;span style="color: #990000;"&gt;Demo&lt;/span&gt;&lt;/a&gt; &lt;/b&gt;| &lt;a href="http://code.google.com/p/rte-light/"&gt;&lt;span style="color: #990000;"&gt;&lt;b&gt;Download&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; )&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Super lightweight 7kb uncompressed&lt;/li&gt;
&lt;li&gt;Compatible with major browsers&lt;/li&gt;
&lt;li&gt;Degrade gracefully&lt;/li&gt;
&lt;li&gt;GNU General Public License&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="border: 1px solid grey; clear: both; text-align: center;"&gt;&lt;a href="http://batiste.dosimple.ch/blog/posts/2007-09-11-1/rich-text-editor-jquery.html" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-Z71GQhcHgSk/TzYg5U1EYJI/AAAAAAAABso/uL19Aw-hQDI/s1600/jQuery+TextEditor+%2528LightWeight%2529.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-9216073907603241039?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/AsHQGMGC3oo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/AsHQGMGC3oo/useful-jquery-text-editor-plugins.html</link><author>noreply@blogger.com (Virendra Dugar)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-LMyrT4uTiBM/TzYfFr-6vzI/AAAAAAAABsY/F5W4gH8tPVM/s72-c/jQuery+TextEditor+(MarkItUp).gif" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/useful-jquery-text-editor-plugins.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-2660237809778748238</guid><pubDate>Mon, 13 Feb 2012 04:00:00 +0000</pubDate><atom:updated>2012-02-13T09:30:03.326+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery Tutorials</category><category domain="http://www.blogger.com/atom/ns#">jQuery Tips</category><category domain="http://www.blogger.com/atom/ns#">jQuery Codes</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><category domain="http://www.blogger.com/atom/ns#">jQuery For Beginners</category><title>Get checkbox status using jQuery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
Below single line of code will provide the status of checkbox using jQuery. It checks whether the checked is checked or not using jQuery and will return 1 or 0.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;var isChecked = $('#chkSelect').attr('checked')?true:false;
&lt;/pre&gt;I have noticed that on many website it is written that 'checked' attribute will return true or false, but this is not correct. If the checked box is checked then it return status as "checked", otherwise "undefined".&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Check Yourself.&lt;/b&gt;  &lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/xe7aL/embedded/result,js/" style="height: 150px; width: 100%;"&gt;&lt;/iframe&gt; &lt;br /&gt;
So if you want to have true or false, then you need to use conditional expression as I have done in the code.&lt;br /&gt;
&lt;br /&gt;
Below are some other ways of checking the status of checkbox.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;var isChecked = $('#chkSelect:checked').val()?true:false;
&lt;/pre&gt;$('#chkSelect:checked').val() method returns "on" when checkbox is checked and "undefined", when checkbox is unchecked.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;var isChecked = $('#chkSelect').is(':checked');
&lt;/pre&gt;The above method uses "is" selector and it returns true and false based on checkbox status.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Check Yourself.&lt;/b&gt;  &lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/KNQbH/embedded/result,js,html/" style="height: 150px; width: 100%;"&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-2660237809778748238?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/uQ02F52ipKc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/uQ02F52ipKc/get-checkbox-status-using-jquery.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/get-checkbox-status-using-jquery.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-3386390334303689775</guid><pubDate>Fri, 10 Feb 2012 04:00:00 +0000</pubDate><atom:updated>2012-02-10T09:30:00.062+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Jquery Code Snippets</category><category domain="http://www.blogger.com/atom/ns#">jQuery Tips</category><category domain="http://www.blogger.com/atom/ns#">jQuery Codes</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><category domain="http://www.blogger.com/atom/ns#">jQuery Code Examples</category><title>Prevent Default behavior using jQuery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
If you want to &lt;b&gt;prevent default behavior&lt;/b&gt; of any element using &lt;b&gt;jQuery&lt;/b&gt; then below little piece of code will help you. For example, the default behavior of the button is click but if you want to prevent it for any reason, then you can use jQuery provide "&lt;b&gt;preventDefault&lt;/b&gt;" method.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function(){
  $("#btnSubmit").click(function(e){
     e.preventDefault();
  });
});
&lt;/pre&gt;
Above code will not perform a postback on click of button. ASP.NET developers are familiar with Postback term but still if you are not familiar with Postback term then [&lt;i&gt;A postback is an HTTP POST to the same page that the form is on. In other words, the contents of the form are POSTed back to the same URL as the form.&lt;/i&gt;]&lt;br /&gt;
&lt;br /&gt;
When JavaScript was on top, then the developers used to write "return false;" to prevent postback. For example, while submitting the form, you are validating the inputs and if inputs are not valid then you don't want to post the data back to server. So in such scenario, "return false;" is used. Well, you can still use "return false;" with jQuery but a better approach is to use "event.preventDefault()".&lt;br /&gt;
&lt;br /&gt;
But then you might be wondering what is the difference between "return false;" and e.preventDefault(). right? Here is your answer.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The "return false;" statement not only disables the default action but it also stops event bubbling, where e.preventDefault() doesn't stop event bubbling. &lt;/b&gt;Read below post for detailed answer and a cool demo.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://css-tricks.com/return-false-and-prevent-default/" rel="nofollow" target="_blank"&gt;&lt;b&gt;&lt;span style="color: #990000;"&gt;The difference between ‘return false;’ and ‘e.preventDefault();’&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-3386390334303689775?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/uQhimBrrBL0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/uQhimBrrBL0/prevent-default-behavior-using-jquery.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/prevent-default-behavior-using-jquery.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-4889302751497136374</guid><pubDate>Thu, 09 Feb 2012 07:33:00 +0000</pubDate><atom:updated>2012-02-09T14:15:28.396+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Jquery Code Snippets</category><category domain="http://www.blogger.com/atom/ns#">jQuery Tips</category><category domain="http://www.blogger.com/atom/ns#">jQuery Codes</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><category domain="http://www.blogger.com/atom/ns#">jQuery Code Examples</category><title>How to check element visible or hidden using jQuery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
Below is a simple piece of &lt;b&gt;jQuery&lt;/b&gt; code which checks the &lt;b&gt;visibility&lt;/b&gt; of element using &lt;b&gt;jQuery&lt;/b&gt;. jQuery provides "&lt;b&gt;visible&lt;/b&gt;" selector which can be used to check the &lt;b&gt;visibility&lt;/b&gt;.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;var isVisible = $('#dvData').is(':visible');
alert("dvData is " + isVisible);
&lt;/pre&gt;If you want to check if element is hidden, then you can use &lt;b&gt;":hidden"&lt;/b&gt; selector. &lt;br /&gt;
&lt;pre class="brush:javascript"&gt;var isHidden  = $('#dvData').is(':hidden');
alert("dvData is " + isHidden);
&lt;/pre&gt;&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/bMUby/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Demo &amp;amp; Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;There is a myth that &lt;b&gt;":visible"&lt;/b&gt; and &lt;b&gt;":hidden"&lt;/b&gt; selector checks for "&lt;a href="http://www.w3schools.com/cssref/pr_class_display.asp" rel="nofollow" target="_blank"&gt;&lt;b&gt;&lt;span style="color: #990000;"&gt;display&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;" css property which is used to show/hide the element. But this is not correct. &lt;br /&gt;
&lt;pre class="brush:javascript"&gt;&amp;lt;div id="dvData" style="display:none;"&amp;gt;
//Your content goes here...
&amp;lt;/div&amp;gt;
&lt;/pre&gt;Before jQuery 1.3.1 (and older) an element was visible if its CSS "display" was not "none", its CSS "visibility" was not "hidden", and its type (if it was an input) was not "hidden" But After jQuery 1.3.1 versions an element is visible if its browser-reported offsetWidth or offsetHeight is greater than 0.&lt;br /&gt;
&lt;br /&gt;
However, if you have used "&lt;a href="http://www.w3schools.com/cssref/pr_class_visibility.asp" rel="nofollow" target="_blank"&gt;&lt;b&gt;&lt;span style="color: #990000;"&gt;visibility&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;" css property to hide the element then ":visible" and ":hidden" selector will not work. Elements with &lt;i&gt;visibility: hidden&lt;/i&gt; or &lt;i&gt;opacity: 0&lt;/i&gt; are considered to be visible, since they still consume space in the layout.&lt;br /&gt;
&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/y58m5/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Demo &amp;amp; Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;So if you have seen the above demo then it must be clear to you that ":visible" and ":hidden" selector will not work with css property "visibility". So what's the solution?&lt;br /&gt;
&lt;br /&gt;
If you have used "visibility" css property to hide the element then use ":hidden" jQuery selector to check the visibility.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;&amp;lt;div id="dvData" style="visibility:hidden;"&amp;gt;
//Your content goes here...
&amp;lt;/div&amp;gt;
&lt;/pre&gt;then use below code to find out where element is visible or not.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;if ($('#dvData').css("visibility") == "hidden")
{
   // Item is hidden. Write your code.
}
else
{
   // Item is Visible. Write your code.
}
&lt;/pre&gt;&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/FpfRE/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Demo &amp;amp; Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;Read "&lt;a href="http://webdesign.about.com/od/css/f/blfaqhidden.htm" rel="nofollow" target="_blank"&gt;&lt;b&gt;&lt;span style="color: #990000;"&gt;What's the difference between display: none and visibility: hidden?&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;"&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-4889302751497136374?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/0vF9LHI0TTI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/0vF9LHI0TTI/how-to-check-element-visible-or-hidden.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/how-to-check-element-visible-or-hidden.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-6796408839843640998</guid><pubDate>Thu, 09 Feb 2012 04:30:00 +0000</pubDate><atom:updated>2012-02-09T10:00:00.057+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Jquery Code Snippets</category><category domain="http://www.blogger.com/atom/ns#">jQuery Codes</category><category domain="http://www.blogger.com/atom/ns#">setTimeOut</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><category domain="http://www.blogger.com/atom/ns#">jQuery Code Examples</category><title>How to use jQuery setTimeout function</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
If you want to delay your &lt;b&gt;jQuery&lt;/b&gt; code to run after some amount of time, you can use JavaScript &lt;b&gt;setTimeout&lt;/b&gt; function to delay the execution. &lt;b&gt;setTimeout&lt;/b&gt; is used in JavaScript to delay execution of some code and the same function can be use with &lt;b&gt;jQuery&lt;/b&gt; without any extra effort. &lt;br /&gt;
&lt;br /&gt;
The Basic syntax for setTimeout function is, &lt;br /&gt;
&lt;pre class="brush:javascript"&gt;setTimeout(function() {
      // Do something after 2 seconds
}, 2000);
&lt;/pre&gt;The &lt;b&gt;setTimeout&lt;/b&gt; function takes the times in miliseconds. And the block can contain either your &lt;b&gt;jQuery&lt;/b&gt; code, or you can also make a call to any function.&lt;br /&gt;
&lt;br /&gt;
For example, if I want to make div element fade out then you can use below code. It will fade out the div with id "dvData" after 2 seconds.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function(){ 
    setTimeout(function(){ 
        $('#dvData').fadeOut();}, 2000); 
});
&lt;/pre&gt;The above code will fade out the div after 2 seconds automatically when page is loaded.&lt;br /&gt;
&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/wggua/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Demo &amp;amp; Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;You can also call this on button click as well. All you need to do is to put the above code on click of button.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function() { 
    $("#btnFade").bind("click",function() {
      setTimeout(function() { 
        $('#dvData').fadeOut();}, 2000); 
  });
});
&lt;/pre&gt;&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/CrLNU/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Demo &amp;amp; Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;You can also use below alternative that is create a function and call it on click of button.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function() { 
    $('#btnFade').bind('click', function() {
      FadeOut();
  }); 
  function FadeOut()
  {
     setTimeout(function() { 
        $('#dvData').fadeOut();}, 2000); 
  } 
});
&lt;/pre&gt;As I mentioned earlier that with &lt;b&gt;setTimeout()&lt;/b&gt;, you can also make a call to another function. Till now, we were writing a piece of code and that is ideal if your code is one line but when lines of code is more then it is better to create a separate function and call it in setTimeout().&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function() { 
    $('#btnFade').bind('click', function() {
      FadeOut();
  });
    
  function FadeOut()
  {
     setTimeout(FadeDiv(), 2000); 
  }
    
  function FadeDiv()
  {
    $('#dvData').fadeOut();
  } 
});
&lt;/pre&gt;&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/Y7aWc/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Demo &amp;amp; Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-6796408839843640998?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/mNvmohsqDX8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/mNvmohsqDX8/how-to-use-jquery-settimeout-function.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/how-to-use-jquery-settimeout-function.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-8555485299029536946</guid><pubDate>Tue, 07 Feb 2012 04:35:00 +0000</pubDate><atom:updated>2012-02-07T11:13:50.165+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Jquery Code Snippets</category><category domain="http://www.blogger.com/atom/ns#">jQuery Tips</category><category domain="http://www.blogger.com/atom/ns#">jQuery Codes</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><category domain="http://www.blogger.com/atom/ns#">jQuery Code Examples</category><title>Extract numbers from string using jQuery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Today I got into a situation where I need to extract the numbers from the string variable on client side using jQuery. If a string has 1 or more occurrence of the numbers then also need to extract it and store it into an array. For example, if the string is  &lt;br /&gt;
&lt;pre class="brush:javascript"&gt;var str = '3jquery33By333Example3333';&lt;/pre&gt;&lt;b&gt;And required output is:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/4DbmT/embedded/result" style="height: 150px; width: 100%;"&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;br /&gt;
So all I need was a regular expression which matches all the numbers in the string and return the array. Below is the jQuery code which I have used.&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/4DbmT/embedded/js,result" style="height: 220px; width: 100%;"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See Complete &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/4DbmT/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-8555485299029536946?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/Lb-Sir5ElQo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/Lb-Sir5ElQo/extract-numbers-from-string-using.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/extract-numbers-from-string-using.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-6204809977202616064</guid><pubDate>Mon, 06 Feb 2012 04:30:00 +0000</pubDate><atom:updated>2012-02-06T14:06:37.334+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sencha Touch</category><category domain="http://www.blogger.com/atom/ns#">jQuery Mobile</category><category domain="http://www.blogger.com/atom/ns#">jQTouch</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><title>jQTouch Vs Sencha Touch vs jQuery Mobile</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
In my previous &lt;a href="http://jquerybyexample.blogspot.in/2012/02/jqtouch-vs-jquery-mobile.html" rel="nofollow"&gt;&lt;b&gt;post&lt;/b&gt;&lt;/a&gt;, I have put together the difference between &lt;b&gt;jQTouch &lt;/b&gt;and &lt;b&gt;jQuery Mobile&lt;/b&gt;. But there is another Mobile Framework named "&lt;b&gt;Sencha Touch&lt;/b&gt;" which is developed by the same person who has created &lt;b&gt;jQTouch&lt;/b&gt;. Before you move further to know more about &lt;b&gt;Sencha Touch&lt;/b&gt;, please read &lt;a href="http://jquerybyexample.blogspot.in/2012/02/jqtouch-vs-jquery-mobile.html" rel="nofollow"&gt;&lt;b&gt;jQTouch vs jQuery Mobile&lt;/b&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #990000; font-size: x-large;"&gt;&lt;b&gt;&lt;u&gt;What is Sencha Touch?&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Sencha Touch is the world's first mobile web app development framework built specifically to leverage HTML5, CSS3, and Javascript for the highest level of power, flexibility, and optimization. It make specific use of HTML5 to deliver components like audio and video, as well as a localStorage proxy for saving data offline. It makes extensive use of CSS3 in our stylesheets to provide the most robust styling layer possible.&lt;br /&gt;
&lt;br /&gt;
Sencha Touch is a cross-platform framework aimed at next generation, touch enabled, devices. It's currently compatible with Apple iOS 3+, Android 2.1+, and BlackBerry 6+ devices. &lt;br /&gt;
&lt;br /&gt;
Altogether, the entire library is under 120kb (gzipped and minified), and it's trivial to make that number even smaller by disabling unused components or styles.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-UO_kbdnszIo/Tyu5el92ddI/AAAAAAAABqY/-Kh3WpQyG58/s1600/SenchaTouch.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="120" src="http://2.bp.blogspot.com/-UO_kbdnszIo/Tyu5el92ddI/AAAAAAAABqY/-Kh3WpQyG58/s320/SenchaTouch.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style="color: #990000; font-size: large;"&gt;&lt;b&gt;&lt;u&gt;Features of Sencha Touch&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;Easy Setup&lt;/li&gt;
&lt;li&gt;Sencha Touch includes a set of graphical user interface GUI-based controls or "components" for use within mobile web applications. These components are highly optimized for touch input.&lt;/li&gt;
&lt;li&gt;Built-in transition effects&lt;/li&gt;
&lt;li&gt;Resolution Independent&lt;/li&gt;
&lt;li&gt;Touch event management: It supports events like Tap, Double Tap, Pinch, Swipe and Scroll.&lt;/li&gt;
&lt;li&gt;Application data support: Sencha Touch has a data package to support web standards for data interchange with servers such as Ajax and JSONP&lt;/li&gt;
&lt;/ul&gt;&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 16px; margin: 16px 0; padding: 5px 0 5px 10px; text-align: center;"&gt;&lt;b&gt;&lt;a href="http://www.sencha.com/products/touch" rel="nofollow" target="_blank"&gt;&lt;span style="color: blue;"&gt;Official Website&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;span style="color: #990000; font-size: x-large;"&gt;&lt;b&gt;&lt;u&gt;Differences&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;jQuery Mobile supports more number of mobile platform as compare to Sencha Touch. Sencha touch only supports iOS, Android and recently Blackberry.&lt;/li&gt;
&lt;li&gt;jQuery Mobile and Sencha touch both provides great UI features with lots of control but Sencha touch wins here. Sencha Touch offers a bit more like lots of icons, or built-in maps.﻿&lt;/li&gt;
&lt;li&gt;jQuery Mobile is easy to use as Sencha Touch is completely Javascript. Your application takes place in js files, dealing with js classes. On the other hand, jQueryMobile is markup-driven. Sencha Touch is an extension of the Ext JS framework. It has a more native language feel than html and does not follow open standards. For example, the entire &amp;lt;body&amp;gt; of a webpage is generated in javascript.&lt;/li&gt;
&lt;li&gt;jQuery Mobile is easy to learn but for Sencha touch one need to put extra effort to learn it. In fact the documentation of Sencha touch is not comprehensive but jQuery Mobile documentation is quite good.&lt;/li&gt;
&lt;li&gt;jQuery mobile is light weight compare to Sencha touch.&lt;/li&gt;
&lt;li&gt;Sencha Touch supports a more MVC style application design, whereas jQuery mobile will simply be a load of markup and a load of jQuery script converting your HTML elements into touch friendly interface components.&lt;/li&gt;
&lt;li&gt;jQuery Mobile Framework is easy to integrate with other technologies.&lt;/li&gt;
&lt;li&gt;jQuery Mobile is free where Sencha Touch is available free of charge for commercial and open source application development. However, embedding Sencha Touch in a web application builder or software development kit (SDK) requires a paid commercial OEM license agreement. Read &lt;a href="http://www.sencha.com/store/licensing-faq/" rel="nofollow" target="_blank"&gt;more&lt;/a&gt; about Sencha Touch Licensing FAQ.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
In the end, no mobile framework is perfect and the choice depends on the project requirement. But my favorite is jQuery Mobile.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-6204809977202616064?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/CosMTQP010A" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/CosMTQP010A/jqtouch-vs-sencha-touch-vs-jquery.html</link><author>noreply@blogger.com (Virendra Dugar)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-UO_kbdnszIo/Tyu5el92ddI/AAAAAAAABqY/-Kh3WpQyG58/s72-c/SenchaTouch.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/jqtouch-vs-sencha-touch-vs-jquery.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-4634222297019274351</guid><pubDate>Wed, 01 Feb 2012 05:00:00 +0000</pubDate><atom:updated>2012-02-01T10:30:00.864+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery Mobile</category><category domain="http://www.blogger.com/atom/ns#">jQTouch</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><title>jQTouch vs jQuery Mobile</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
Today, mobile is a very common object and that's why Mobile frameworks are in very much demand. In this post, I will show you brief walk through of 2 most popular jQuery based mobile framework "&lt;b&gt;jQTouch&lt;/b&gt;" and "&lt;b&gt;jQuery Mobile&lt;/b&gt;". And I will also explain the &lt;b&gt;differences&lt;/b&gt; between "&lt;b&gt;jQTouch&lt;/b&gt;" and "&lt;b&gt;jQuery Mobile&lt;/b&gt;".&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-RjHyc-_kyYE/TyfF_v9EWhI/AAAAAAAABqM/9KmOahjW_DM/s1600/jQTouch+vs+jQueryMobile.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="180" src="http://1.bp.blogspot.com/-RjHyc-_kyYE/TyfF_v9EWhI/AAAAAAAABqM/9KmOahjW_DM/s200/jQTouch+vs+jQueryMobile.PNG" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #990000; font-size: x-large;"&gt;&lt;b&gt;&lt;u&gt;What is jQTouch?&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
First thing I want to clear about jQTouch is that "&lt;b&gt;It is not a framework&lt;/b&gt;". Its a myth that it is a framework. (&lt;i&gt;Though I have also mentioned earlier in my post, but that's a myth&lt;/i&gt;) &amp;nbsp;jQTouch is a jQuery plugin for mobile web development on the iPhone, Android, iPod Touch, and other forward-thinking devices. It supports minified code, native WebKit animations, swipe detection, auto list navigation, flexible themes, has the ability to be tweaked with custom extensions. jQTouch is built by David Kaneda and maintained by Jonathan Stark.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-l4D6PFt_mnI/TyfEcvqN_bI/AAAAAAAABp8/3rpTCGDu1u4/s1600/jQTouch.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-l4D6PFt_mnI/TyfEcvqN_bI/AAAAAAAABp8/3rpTCGDu1u4/s320/jQTouch.PNG" width="170" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style="color: #990000; font-size: large;"&gt;&lt;b&gt;&lt;u&gt;Features of jQTouch&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;Easy Setup&lt;/li&gt;
&lt;li&gt;Native WebKit Animations&lt;/li&gt;
&lt;li&gt;Image Preloading&lt;/li&gt;
&lt;li&gt;Callback Events&lt;/li&gt;
&lt;li&gt;Flexible Themes&lt;/li&gt;
&lt;li&gt;MIT Licensed&lt;/li&gt;
&lt;li&gt;Swipe Detection&lt;/li&gt;
&lt;li&gt;Extensions&lt;/li&gt;
&lt;li&gt;Improved File Size&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
jQTouch is focussed strictly on the iPhone, iPod Touch, and soon, Android. jQTouch progressively enhances HTML and CSS, so that less capable phones are still be able to browse content.&lt;br /&gt;
&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 16px; margin: 16px 0; padding: 5px 0 5px 10px; text-align: center;"&gt;&lt;b&gt;&lt;a href="http://jqtouch.com/" rel="nofollow" target="_blank"&gt;&lt;span style="color: blue;"&gt;Official Website&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;b&gt;&lt;span style="color: #990000; font-size: x-large;"&gt;&lt;u&gt;What is jQuery Mobile?&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
jQuery Mobile is touch-Optimized Web Framework for Smartphones &amp;amp; Tablets. A unified, HTML5-based user interface system for all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Its lightweight code is built with progressive enhancement, and has a flexible, easily themeable design.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-dna8xAss2_8/TyfD1__NWsI/AAAAAAAABps/7xp7XUxryL8/s1600/jQueryMobile.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="312" src="http://3.bp.blogspot.com/-dna8xAss2_8/TyfD1__NWsI/AAAAAAAABps/7xp7XUxryL8/s320/jQueryMobile.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style="color: #990000; font-size: large;"&gt;&lt;b&gt;&lt;u&gt;Features of jQuery Mobile&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;Built on jQuery core&lt;/li&gt;
&lt;li&gt;Compatible with all major mobile, tablet, e-reader &amp;amp; desktop platforms&lt;/li&gt;
&lt;li&gt;Lightweight size and minimal image dependencies for speed&lt;/li&gt;
&lt;li&gt;Modular architecture&lt;/li&gt;
&lt;li&gt;HTML5 Markup-driven configuration&lt;/li&gt;
&lt;li&gt;Progressive enhancement&lt;/li&gt;
&lt;li&gt;Powerful Ajax-powered navigation system&lt;/li&gt;
&lt;li&gt;Touch and mouse event support &lt;/li&gt;
&lt;li&gt;Unified UI widgets&lt;/li&gt;
&lt;li&gt;Powerful theming framework &lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
jQuery Mobile is built upon standard, semantic HTML, allowing pages to be accessible to the broadest range of devices possible. For A-Grade browsers, many of the components in jQuery Mobile leverage techniques such as focus management, keyboard navigation, and HTML attributes specified in the W3C's WAI-ARIA specification.&lt;br /&gt;
&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 16px; margin: 16px 0; padding: 5px 0 5px 10px; text-align: center;"&gt;&lt;b&gt;&lt;a href="http://jquerymobile.com/" rel="nofollow" target="_blank"&gt;&lt;span style="color: blue;"&gt;Official Website&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;span style="color: #990000; font-size: x-large;"&gt;&lt;b&gt;&lt;u&gt;Differences&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;As I have stated earlier that jQTouch is not a framework, it is plugin. Where jQuery Mobile is framework created for Mobile and tablet devices.&lt;/li&gt;
&lt;li&gt;jQTouch is optimized for WebKit.Therefore jQTouch might be preferable if you plan on specifically targeting users tied to an iOS- or Android-based device. Where jQuery Mobile is compatible with all major mobile and tablet platforms. &lt;/li&gt;
&lt;li&gt;jQTouch provides access to Geolocation (Access to device GPS Data) where jQuery Mobile doesn't provide this hardware access(to date). &lt;/li&gt;
&lt;li&gt;jQTouch is focused on small screen devices. From &lt;a href="http://blog.jqtouch.com/post/726299094/jqtouch-roadmap" rel="nofollow" target="_blank"&gt;their blog&lt;/a&gt;.&lt;br /&gt;
&lt;i&gt;"&lt;span style="background-color: #cccccc;"&gt;Apps developed with jQTouch will certainly run fine on iPads and other tablet devices, but we aren’t going to automagically convert to a more tablet-friendly UI that takes advantage of the additional real estate.&lt;/span&gt;"&lt;br /&gt;
&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;In terms of performance jQTouch is better than jQuery Mobile. If you are targeting only Webkit devices then go for jQTouch.&lt;/li&gt;
&lt;li&gt;Though jQTouch project is technically active, the original author has moved on and development seems to have slowed where jQuery Mobile Announced in August 2010, it’s quickly progressed to a very functional Alpha 2.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
This guy named "&lt;a href="http://www.markus-falk.com/index_en.html" target="_blank"&gt;Markus Falk&lt;/a&gt;" has created a frequently-updated chart that shows of pros and cons of all the mobile frameworks out there.&lt;br /&gt;
&lt;br /&gt;
The chart displays the rendering engines supported, target platform, hardware, development languages, license and UI features for each framework. Plus, it also has a wizard feature which allows to filter the framework based on various functionality.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.markus-falk.com/mobile-frameworks-comparison-chart/" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-FkyCcVEwxpM/Tye_MCbGxkI/AAAAAAAABpk/AoihfXvthXA/s1600/Mobile+Framework+Comparison.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px; text-align: center;"&gt;&lt;b&gt;&lt;a href="http://www.markus-falk.com/mobile-frameworks-comparison-chart/" rel="nofollow" target="_blank"&gt;&lt;span style="color: blue;"&gt;View Comparison Chart&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-4634222297019274351?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/2z8pbj_1T60" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/2z8pbj_1T60/jqtouch-vs-jquery-mobile.html</link><author>noreply@blogger.com (Virendra Dugar)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-RjHyc-_kyYE/TyfF_v9EWhI/AAAAAAAABqM/9KmOahjW_DM/s72-c/jQTouch+vs+jQueryMobile.PNG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/02/jqtouch-vs-jquery-mobile.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-2872903391406939354</guid><pubDate>Wed, 25 Jan 2012 05:00:00 +0000</pubDate><atom:updated>2012-01-25T13:57:55.284+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery innerText</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><title>Set innerText using jQuery</title><description>&lt;br /&gt;
In this post, I will explain that how to set &lt;b&gt;innerText &lt;/b&gt;using &lt;b&gt;jQuery&lt;/b&gt;. But do you know what is &lt;b&gt;innerText&lt;/b&gt;? &lt;b&gt;innerText&lt;/b&gt; term means text which appears between the start tag and end tag. In JavaScript, the "inner" text of an HTML element refers to the text between any set of HTML tags and using &lt;b&gt;innerText&lt;/b&gt; property, one can set the text in JavaScript. But to set &lt;b&gt;innerText&lt;/b&gt; using &lt;b&gt;jQuery&lt;/b&gt;, use text() method. &lt;b&gt;jQuery&lt;/b&gt; text() method sets the innerText of any element. Well, we can still club the jQuery and JavaScript without any problem and it will work.  A example of innerText would be below. &lt;br /&gt;
&lt;pre class='brush:javascript'&gt;&amp;lt;span&amp;gt;I am innerText of span element&amp;lt;/span&amp;gt;&lt;/pre&gt;As I mentioned earlier that one can still use JavaScript in jQuery code so that means one can still use &lt;b&gt;innerText&lt;/b&gt; in jQuery to set &lt;b&gt;innerText&lt;/b&gt; of any element but there is a problem with this property. This property doesn't work with Firefox. It works quite well with IE and Chrome. So the similar property for Firefox is &lt;b&gt;textContent&lt;/b&gt;. But textContent doesn't work with other browsers like IE and Chrome. &lt;br /&gt;
&lt;br /&gt;
As we know that one of the advantage of jQuery is browser independence. So the text() method works in all the browsers. So it works like the textContent property in Firefox and innerText in IE.&lt;br /&gt;
&lt;br /&gt;
Using text() function, you can not only set the text but you can also get the text of element. For example, if you want to set text for any div with id "dvElement" then use following code.&lt;br /&gt;
&lt;pre class='brush:javascript'&gt;$(document).ready(function()
{
    $("#dvExample").text('I am new content of the div.')
});
&lt;/pre&gt;And to get the text of the div,&lt;br /&gt;
&lt;pre class='brush:javascript'&gt;$(document).ready(function()
{
    $("#dvExample").text('I am new content of the div.')
    var dvText = $("#dvExample").text();
    alert(dvText);          
});
&lt;/pre&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://4.bp.blogspot.com/_pP4JIb2v5LA/TEZ0WJw3k6I/AAAAAAAABQ4/60xnf3qoOF8/s1600/SetText.PNG" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_pP4JIb2v5LA/TEZ0WJw3k6I/AAAAAAAABQ4/60xnf3qoOF8/s320/SetText.PNG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-2872903391406939354?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/C-zFJGnKMaY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/C-zFJGnKMaY/set-innertext-using-jquery.html</link><author>noreply@blogger.com (Virendra Dugar)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_pP4JIb2v5LA/TEZ0WJw3k6I/AAAAAAAABQ4/60xnf3qoOF8/s72-c/SetText.PNG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/01/set-innertext-using-jquery.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-5327566273058288480</guid><pubDate>Tue, 24 Jan 2012 05:00:00 +0000</pubDate><atom:updated>2012-01-24T10:30:01.955+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery</category><title>Write and test your jQuery code online</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
In this post, you will see 3 different website which provides web playground to write and test your jQuery code online. The advantage of using these online playground is that one can use it as an online editor for snippets build from HTML, CSS and JavaScript. The code can then be shared with others, embedded on a blog.&lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;a href="http://jsfiddle.net/"&gt;&lt;b&gt;&lt;span style="color: purple; font-size: large;"&gt;jsFiddle&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
The first website is "&lt;a href="http://jsfiddle.net/"&gt;&lt;b&gt;jsFiddle&lt;/b&gt;&lt;/a&gt;", which provides an online environment where anyone can test his code against many Javascript frameworks like jQuery, MooTools, Dojo, Prototype and many more.. The one very important feature of this website is as and when new version of any library is released, it is available on &lt;a href="http://jsfiddle.net/"&gt;&lt;b&gt;jsFiddle&lt;/b&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-nAfehZwqHv4/Tx0qPRkddgI/AAAAAAAABo0/FI7GX3ZYYTM/s1600/jsFiddle+-+Online+Editor+for+the+Web+%2528JavaScript%252C+MooTools%252C+jQuery%252C+Prototype%252C+YUI%252C+Glow+and+Dojo%252C+HTML%252C+CSS%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="452" src="http://4.bp.blogspot.com/-nAfehZwqHv4/Tx0qPRkddgI/AAAAAAAABo0/FI7GX3ZYYTM/s640/jsFiddle+-+Online+Editor+for+the+Web+%2528JavaScript%252C+MooTools%252C+jQuery%252C+Prototype%252C+YUI%252C+Glow+and+Dojo%252C+HTML%252C+CSS%2529.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;As you can see from the above screenshot, the website is divided into 5 parts. On the very left, you need to select your framework and its version as well. Suppose, you want to test your code against jQuery then select jQuery and its related version. You are also allowed to test jQuery UI. If you also want to add any external javascript or css, then you can also add its URL under "Add Resoruce" Tab.&lt;br /&gt;
&lt;br /&gt;
Other parts of the interface are HTML editor, CSS editor, Script editor and your output. As the name suggest, Put all your HTML code in HTML editor, CSS code in CSS editor and Javascript/jQuery code in Script editor. Output section is used to see the output.&lt;br /&gt;
&lt;br /&gt;
Write your code and hit run button on the top. And you will see the output in output section. You can also save your code (Save button). Once you save the code, then copy the URL and use it for future reference. It also maintains version. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Features:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;Inbuilt mechanism to reference any of the javascript library&lt;/li&gt;
&lt;li&gt;Supports of latest and previous version of libraries&lt;/li&gt;
&lt;li&gt;Maintains different versions&lt;/li&gt;
&lt;li&gt;Support of Tidy up which arranges your messy code&lt;/li&gt;
&lt;li&gt;Support of jsLint, (Javascript code quality tool)&lt;/li&gt;
&lt;li&gt;Allows to share the page with social media websites.&lt;/li&gt;
&lt;li&gt;Support to mark the first version as base version.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
I use this website to make demo for my post to share with my you guys. There are many features which you can explore. So what are waiting for? Start using &lt;a href="http://jsfiddle.net/"&gt;&lt;b&gt;jsFiddle&lt;/b&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;a href="http://code.google.com/apis/ajax/playground/#jquery"&gt;&lt;b&gt;&lt;span style="color: purple; font-size: large;"&gt;Google Code PlayGround&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Next is Google Code PlayGround developed by Google to write and test not only jQuery but one can also write and test against the APIs provides by various Google services like Google Maps, YouTube, Google Earth and many more...&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ccvgPEYO6tg/Tx0kZHXR-pI/AAAAAAAABok/eDJwq2qviU0/s1600/Google+Code+Playground.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="489" src="http://2.bp.blogspot.com/-ccvgPEYO6tg/Tx0kZHXR-pI/AAAAAAAABok/eDJwq2qviU0/s640/Google+Code+Playground.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
As you can see from the screenshot, website interface is divided into 3 parts.&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;&lt;li&gt;First part to select libraries. There are various libraries available.&lt;/li&gt;
&lt;li&gt;Second to write your HTML, CSS and Script.&lt;/li&gt;
&lt;li&gt;Third is Output section.&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;The good thing about this website is you can also debug your code step by step which is a very nice feature.&lt;/div&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;a href="http://jsbin.com/"&gt;&lt;b&gt;&lt;span style="color: purple; font-size: large;"&gt;jsbin&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;a href="http://jsbin.com/"&gt;&lt;b&gt;jsBin&lt;/b&gt;&lt;/a&gt; is another cool website to fulfill your purpose. Before jsFiddle, I used this website a lot to create demos for my blog post. Like jsFiddle, this website also provides separate section for HTML, Script and Real Time Preview.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://jsbin.com/" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="354" src="http://3.bp.blogspot.com/-6pAdJEuKK44/Tx1FTHfXADI/AAAAAAAABo8/6h3FLOTd9yg/s640/jsbin.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;a href="http://jsbin.com/"&gt;&lt;b&gt;jsBin&lt;/b&gt;&lt;/a&gt; also provide 2 different views "Code" and "Render". When you click on Render view, you will see the output section in complete page which is sometimes very useful as the Real Time Preview section is small and it sometimes may not be useful to see the complete output.&lt;br /&gt;
&lt;br /&gt;
One disadvantage with this website is, it does not provide an inbuilt mechanism to select any library. You need to reference it from any of the CDN. Read "&lt;a href="http://jquerybyexample.blogspot.com/2012/01/why-to-use-google-hosted-jquery-cdn.html"&gt;Why to use Google hosted jQuery CDN&lt;/a&gt;". &lt;br /&gt;
&lt;br /&gt;
I have create a sample demo using &lt;a href="http://jsbin.com/"&gt;&lt;b&gt;jsBin&lt;/b&gt;&lt;/a&gt;. Visit&amp;nbsp;&lt;a href="http://jsbin.com/aracuf/edit"&gt;http://jsbin.com/aracuf/edit&lt;/a&gt;&lt;br /&gt;
Like jsFiddle, jsBin also maintains different version. See URL &lt;a href="http://jsbin.com/aracuf/2/edit#source"&gt;http://jsbin.com/aracuf/2/edit#source&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Visit &lt;a href="http://jsbin.tumblr.com/"&gt;&lt;b&gt;here&lt;/b&gt;&lt;/a&gt; to find out all the features of &lt;a href="http://jsbin.com/"&gt;&lt;b&gt;jsBin&lt;/b&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Personally, I prefer&amp;nbsp;&lt;b&gt;&lt;a href="http://jsfiddle.net/"&gt;jsFiddle&lt;/a&gt;&lt;/b&gt; due to its wide range of features. So what are you waiting for. Just play with these sites and start using them regularly for your jQuery code.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-5327566273058288480?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/DzmS7Ts7Jg8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/DzmS7Ts7Jg8/write-and-test-your-jquery-code-online.html</link><author>noreply@blogger.com (Virendra Dugar)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-nAfehZwqHv4/Tx0qPRkddgI/AAAAAAAABo0/FI7GX3ZYYTM/s72-c/jsFiddle+-+Online+Editor+for+the+Web+%2528JavaScript%252C+MooTools%252C+jQuery%252C+Prototype%252C+YUI%252C+Glow+and+Dojo%252C+HTML%252C+CSS%2529.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/01/write-and-test-your-jquery-code-online.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-4438544463164186491</guid><pubDate>Mon, 23 Jan 2012 05:00:00 +0000</pubDate><atom:updated>2012-01-23T11:06:12.946+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery Validation</category><category domain="http://www.blogger.com/atom/ns#">jQuery DatePicker</category><category domain="http://www.blogger.com/atom/ns#">jQuery With ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">Validation</category><category domain="http://www.blogger.com/atom/ns#">jQuery UI DatePicker</category><category domain="http://www.blogger.com/atom/ns#">jQuery UI</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><title>End Date should not be greater than Start Date using jQuery Date Picker</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;How many times you have seen this message on websites? OR as a programmer, you should have implemented this very common date validation which is "&lt;b&gt;End Date should not be greater than Start Date&lt;/b&gt;". Gone those days where you write long java script functions for date validation and alert/show a error message on screen. It will be a nice feature where you don't allow end user to make mistake. Okay, enough talking now. In this post I will show you how to make "&lt;b&gt;End Date should not be greater than Start Date&lt;/b&gt;" using &lt;b&gt;jQuery and &lt;a href="http://jquerybyexample.blogspot.com/2010/06/implement-jqueryui-datepicker-with.html"&gt;jQuery UI Datepicker&lt;/a&gt;&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;span style="color: purple;"&gt;Read my series of articles about &lt;a href="http://jquerybyexample.blogspot.com/search/label/jQuery%20UI%20DatePicker"&gt;jQuery UI Datepicker&lt;/a&gt;&lt;/span&gt;&lt;/i&gt;.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Required Resources:&lt;br /&gt;
1. &lt;a href="http://docs.jquery.com/Downloading_jQuery" target="_blank"&gt;jQuery&lt;/a&gt;&lt;br /&gt;
2. &lt;a href="http://jqueryui.com/download" target="_blank"&gt;jQuery UI and jQuery UI CSS&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Okay, so there are mainly 2 kind of validation conditions which are,&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;&lt;li&gt;Start date should not greater than end date.&lt;/li&gt;
&lt;li&gt;End date should not less then start date.&lt;/li&gt;
&lt;/ol&gt;So let's put 2 textboxes "txtFromDate" and "txtToDate" and assign Date picker to it. With jQuery UI Date picker, there is an event "onSelect" which fires when any date is selected. So using this event, set the date range for other date pickers. &lt;br /&gt;
&lt;br /&gt;
For example, when from date is selected, then using this "onSelect" event we will set the "minDate" attribute of "txtToDate" textbox to the selected date in "txtFromDate". What it does is that, dates less than the selected from date will be disabled in "txtToDate" textbox. And same way set the "MaxDate" attribute for "txtFromDate" in onSelect event of "txtToDate" textbox. Below is the complete jQuery code.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function(){
    $("#txtFromDate").datepicker({
        numberOfMonths: 2,
        onSelect: function(selected) {
          $("#txtToDate").datepicker("option","minDate", selected)
        }
    });
    $("#txtToDate").datepicker({ 
        numberOfMonths: 2,
        onSelect: function(selected) {
           $("#txtFromDate").datepicker("option","maxDate", selected)
        }
    });  
});
&lt;/pre&gt;"numberOfMonths" attribute allows to display multiple months in date picker. Read &lt;a href="http://jquerybyexample.blogspot.com/2010/06/implement-jqueryui-datepicker-with.html"&gt;&lt;b&gt;here&lt;/b&gt;&lt;/a&gt; about all the attribute of jQuery UI Datepicker.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;See result below.&lt;/b&gt;  &lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/CkfDP/embedded/result,js,html" style="height: 300px; width: 100%;"&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See Complete &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/CkfDP/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;Okay, this is interesting. But there is one more important condition which is also needed.&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;&lt;li&gt;Start date should not be greater than today's date.&lt;/li&gt;
&lt;/ol&gt;Along with, there is one more functionality which you must have seen like many websites like flight booking, railway booking where there is a limit for To Date as well. For example, in India train ticket booking is only possible for next 90 days from the current date.&lt;br /&gt;
&lt;br /&gt;
Okay so let's see that how we can implement these 2 conditions as well using jQuery UI DatePicker. &lt;br /&gt;
&lt;br /&gt;
jQuery UI DatePicker provides attributes "MinDate" and "MaxDate" which allows to set minimum permissible date and maximum permissible date. So when "minDate" attribute is set to 0, then past dates will become disable from current date. And set "maxDate" to "+90D" which will make all the future dates disable except 90 days from current date. See below jQuery code. In this example, I have set "maxDate" to 60 days plus only. &lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function(){
    $("#txtFromDate").datepicker({
        minDate: 0,
        maxDate: "+60D",
        numberOfMonths: 2,
        onSelect: function(selected) {
          $("#txtToDate").datepicker("option","minDate", selected)
        }
    });
    $("#txtToDate").datepicker({ 
        minDate: 0,
        maxDate:"+60D",
        numberOfMonths: 2,
        onSelect: function(selected) {
           $("#txtFromDate").datepicker("option","maxDate", selected)
        }
    });  
});
&lt;/pre&gt;&lt;b&gt;See result below.&lt;/b&gt;  &lt;iframe allowfullscreen="allowfullscreen" frameborder="1" src="http://jsfiddle.net/jquerybyexample/LGw6F/embedded/result,js,html" style="height: 350px; width: 100%;"&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See Complete &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/LGw6F/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;One advice: If you are still using Java Script, stop using it and switch to jQuery.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-4438544463164186491?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/Z2psBeu9E3Y" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/Z2psBeu9E3Y/end-date-should-not-be-greater-than.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/01/end-date-should-not-be-greater-than.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-7820152428328575900</guid><pubDate>Fri, 20 Jan 2012 05:13:00 +0000</pubDate><atom:updated>2012-01-20T10:54:12.946+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Date Picker</category><category domain="http://www.blogger.com/atom/ns#">jQuery UI DatePicker</category><category domain="http://www.blogger.com/atom/ns#">jQuery Plugins</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><title>5 jQuery DatePicker Plugin collection</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
There is no doubt that website are getting more and more user friendly these days and with the growth in technologies, it is not that difficult to make such websites. For example,&amp;nbsp;you will not find simple input boxes or 3 select boxes (day, month and year)&amp;nbsp;for date input. With jQuery, jQuery UI and Ajax, things looks pretty awesome and catching.&lt;br /&gt;
&lt;br /&gt;
In this post, I have put together a collection of some of the best jQuery DatePicker plugins which are&amp;nbsp;very user friendly&amp;nbsp;can be easily integrated with minor modifications. These plugins are developed using jQuery, jQuery UI, Ajax.&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://code.gautamlad.com/glDatePicker/#about"&gt;&lt;span style="color: purple;"&gt;glDatePicker&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
( &lt;b&gt;&lt;a href="http://code.gautamlad.com/glDatePicker/"&gt;&lt;span style="color: #990000;"&gt;Demo&lt;/span&gt;&lt;/a&gt; &lt;/b&gt;| &lt;a href="http://code.gautamlad.com/glDatePicker/#download"&gt;&lt;span style="color: #990000;"&gt;&lt;b&gt;Download&lt;/b&gt; &lt;/span&gt;&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://code.gautamlad.com/glDatePicker/" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="206" src="http://1.bp.blogspot.com/-0CGZDtwUkdQ/Txjupfw_GZI/AAAAAAAABn0/NXsOxjYvBkk/s400/glDatePicker+-+A+simple%252C+customizable%252C+lightweight+date+picker+calendar+plugin+for+jQuery.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://code.gautamlad.com/glDatePicker/#about"&gt;&lt;span style="color: purple;"&gt;Ajax Booking Calendar Pro&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
( &lt;b&gt;&lt;a href="http://codecanyon.net/item/ajax-booking-calendar-pro-jquery-plugin/full_screen_preview/244645?ref=themespotters"&gt;&lt;span style="color: #990000;"&gt;Demo&lt;/span&gt;&lt;/a&gt; &lt;/b&gt;| &lt;a href="http://codecanyon.net/item/ajax-booking-calendar-pro-jquery-plugin/244645?ref=themespotters"&gt;&lt;b&gt;&lt;span style="color: #990000;"&gt;Download&lt;/span&gt;&lt;/b&gt;&lt;/a&gt; )&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://codecanyon.net/item/ajax-booking-calendar-pro-jquery-plugin/full_screen_preview/244645?ref=themespotters" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://2.bp.blogspot.com/-URtDimqxQQM/Txjup9grt1I/AAAAAAAABn4/nMnFuR6K0R0/s400/AJAX+Booking+Calendar+Pro+%2528jQuery+Plugin%2529+Preview+-+CodeCanyon.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://code.gautamlad.com/glDatePicker/#about"&gt;&lt;span style="color: purple;"&gt;jQuery.calendarPicker&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
( &lt;b&gt;&lt;a href="http://bugsvoice.com/applications/bugsVoice/site/test/calendarPickerDemo.jsp"&gt;&lt;span style="color: #990000;"&gt;Demo&lt;/span&gt;&lt;/a&gt; &lt;/b&gt;| &lt;b&gt;&lt;a href="http://bugsvoice.com/applications/bugsVoice/site/test/calendarPicker.zip"&gt;&lt;span style="color: #990000;"&gt;Download&lt;/span&gt;&lt;/a&gt;&lt;/b&gt; )&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://bugsvoice.com/applications/bugsVoice/site/test/calendarPickerDemo.jsp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="125" src="http://1.bp.blogspot.com/-99hpXBqWUX4/TxjuqTq3xfI/AAAAAAAABoE/DafK-AOkEfQ/s400/BugsVoice+-+turn+bugs+into+opportunities.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://www.filamentgroup.com/lab/date_range_picker_using_jquery_ui_16_and_jquery_ui_css_framework/"&gt;&lt;span style="color: purple;"&gt;Date Range Picker using jQuery UI 1.6 and jQuery UI CSS Framework&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
( &lt;b&gt;&lt;a href="http://www.filamentgroup.com/examples/daterangepicker_v2/index2.php"&gt;&lt;span style="color: #990000;"&gt;Demo&lt;/span&gt;&lt;/a&gt; &lt;/b&gt;| &lt;a href="http://www.filamentgroup.com/examples/daterangepicker_v2/FilamentGroup_daterangepicker.zip"&gt;&lt;span style="color: #990000;"&gt;&lt;b&gt;Download&lt;/b&gt;&lt;/span&gt; &lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.filamentgroup.com/lab/date_range_picker_using_jquery_ui_16_and_jquery_ui_css_framework/" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="166" src="http://4.bp.blogspot.com/-p5bxnn-Gudc/Txjur-UOq4I/AAAAAAAABoM/kwPppjfiypA/s400/Filament+Group+Lab+Example+From+Page+from-+Date+Range+Picker+using+jQuery+UI+1.6+and+jQuery+UI+CSS+Framework.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://code.gautamlad.com/glDatePicker/#about"&gt;&lt;span style="color: purple;"&gt;wdCalendar – jQuery Based Google Calendar Clone&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
( &lt;b&gt;&lt;a href="http://www.web-delicious.com/jquery-plugins-demo/wdCalendar/sample.php"&gt;&lt;span style="color: #990000;"&gt;Demo&lt;/span&gt;&lt;/a&gt; &lt;/b&gt;| &lt;a href="http://www.web-delicious.com/jquery-plugins-demo/wdCalendar.zip"&gt;&lt;span style="color: #990000;"&gt;&lt;b&gt;Download&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; )&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.web-delicious.com/jquery-plugins-demo/wdCalendar/sample.php" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="283" src="http://1.bp.blogspot.com/-QJvlNKH6f2M/TxjuvGpmD5I/AAAAAAAABoU/zVRbqZEPflk/s400/My+Calendar.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-7820152428328575900?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/4xBsP8d_Diw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/4xBsP8d_Diw/5-jquery-datepicker-plugin-collection.html</link><author>noreply@blogger.com (Virendra Dugar)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-0CGZDtwUkdQ/Txjupfw_GZI/AAAAAAAABn0/NXsOxjYvBkk/s72-c/glDatePicker+-+A+simple%252C+customizable%252C+lightweight+date+picker+calendar+plugin+for+jQuery.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/01/5-jquery-datepicker-plugin-collection.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-3385328360218555028</guid><pubDate>Wed, 18 Jan 2012 05:00:00 +0000</pubDate><atom:updated>2012-01-19T11:06:11.592+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery 1.7</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><category domain="http://www.blogger.com/atom/ns#">jQuery Code Examples</category><title>How to use jQuery on() and off() method</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
&lt;a href="http://www.andismith.com/blog/2011/11/on-and-off/"&gt;&lt;span style="color: #990000;"&gt;Using jQuery .on() and .off() – AndiSmith.com&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
jQuery 1.7 was &lt;b&gt;&lt;a href="http://jquerybyexample.blogspot.com/2011/11/whats-new-in-jquery-17.html" target="_blank"&gt;released&lt;/a&gt; &lt;/b&gt;in month of November last year and with the jQuery 1.7, do you know that &lt;a href="http://jquerybyexample.blogspot.com/2010/06/jquery-live-function-exampledemo.html" target="_blank"&gt;&lt;b&gt;live()&lt;/b&gt;&lt;/a&gt; method is deprecated. And new method was introduced to replace live() called "&lt;b&gt;on()&lt;/b&gt;". "jQuery &lt;b&gt;on()&lt;/b&gt;" is a new way to attach events to selectors. The on() event handler is designed to replace both the .bind() and .delegate() event handlers.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-NjYbZ_EL01A/Txeroo8E02I/AAAAAAAABno/TSMf2kQ68Ck/s1600/jQuery%2BOn-Off.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://4.bp.blogspot.com/-NjYbZ_EL01A/Txeroo8E02I/AAAAAAAABno/TSMf2kQ68Ck/s200/jQuery%2BOn-Off.jpg" width="176" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
I have found an &lt;a href="http://www.andismith.com/blog/2011/11/on-and-off/"&gt;&lt;span style="color: #990000;"&gt;&lt;b&gt;article&lt;/b&gt;&lt;/span&gt;&lt;/a&gt; with the explanation of these new functions. Along with explanation, it also throws light on some other aspects to the changes in jQuery 1.7+ that one should keep in mind.&lt;br /&gt;
&lt;br /&gt;
Also read, "&lt;a href="http://jquerybyexample.blogspot.com/2010/08/bind-vs-live-vs-delegate-function.html" target="_blank"&gt;&lt;b&gt;&lt;span style="color: #990000;"&gt;bind() vs live() vs delegate() method&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;"&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Why live was deprecated()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
There are a number of problems with .live(), especially with poor performance on large pages, a slower response or unexpected behaviour due to .live() events being attached to the document element. Unfortunately there are still a large number of developers using .live() in their code. If you’re one of them, please stop. See "&lt;a href="http://www.ultimatewebtips.com/why-jquery-live-is-a-bad-option-to-use/" target="_blank"&gt;&lt;b&gt;&lt;span style="color: #990000;"&gt;Why .live() is a Bad Option&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;" for more information.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-3385328360218555028?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/GEUqm_atPUk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/GEUqm_atPUk/how-to-use-jquery-on-and-off-method.html</link><author>noreply@blogger.com (Virendra Dugar)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-NjYbZ_EL01A/Txeroo8E02I/AAAAAAAABno/TSMf2kQ68Ck/s72-c/jQuery%2BOn-Off.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/01/how-to-use-jquery-on-and-off-method.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-8848037488351199920</guid><pubDate>Tue, 17 Jan 2012 05:30:00 +0000</pubDate><atom:updated>2012-02-26T12:37:06.857+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery Array</category><category domain="http://www.blogger.com/atom/ns#">jQuery Tips</category><category domain="http://www.blogger.com/atom/ns#">jQuery Codes</category><category domain="http://www.blogger.com/atom/ns#">jQuery Interview Question</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><title>Difference between sorting string array and numerical array in jQuery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;To sort any array, there is a predefined method called "sort" which sorts the array. sort() method sorts the string array in alphabetical order. This method sorts on the basis of the ASCII values, so it is better to have all uniform names. That is, they must begin with either uppercase or lowercase, but not mixed case. So to sort any string array use the sort method. Below jQuery code sort the string array. &lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function() {
  var list= [ "jQuery", "Dojo", "JavaScript", "Ajax"];
  $('#alltech').html(list.join(""));
  list = list.sort();
  $('#sorted').html(list.join(""));
})
&lt;/pre&gt;&lt;b&gt;See result below.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe style="width: 100%; height: 270px" src="http://jsfiddle.net/jquerybyexample/xvjAW/embedded/result,js,html" allowfullscreen="allowfullscreen" frameborder="1"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See Complete &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/xvjAW/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;Now, declare any numerical array and try to use the sort method on this. Just try the below code to check the output.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function() {
  var list= [ 45, 32, 98, 24, 16, 9, 3];
  $('#allnumber').html(list.join(""));
  list = list.sort();
  $('#sorted').html(list.join(""));
})
&lt;/pre&gt;&lt;b&gt;See result below.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe style="width: 100%; height: 370px" src="http://jsfiddle.net/jquerybyexample/AhUzZ/embedded/result,js,html" allowfullscreen="allowfullscreen" frameborder="1"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Surprised!!!!!!!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Well, the numerical values are not sorted correctly with the sort() method because as mentioned earlier that it considers the ASCII value of the first numerical digit of all numerical values for sorting purposes. To sort numerical values correctly, we must define a comparison function with sort().&lt;br /&gt;
&lt;br /&gt;
If we define a comparison function, then a pair of values from the array will be repeatedly sent to the function until all elements of the array are processed. In the comparison function, we thus write a statement considering the pair of values passed to it so that the function returns any of the following three values: &amp;lt;0, =0, or &amp;gt;0.&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;When the function returns value &amp;lt;0, the second value (of the pair of array values sent to the function) is larger than the first value and hence must be pushed down the sorting order.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;When the function returns value &amp;gt;0, the first value is larger than the second value, so it must be pushed down the sorting order.&lt;/li&gt;
&lt;li&gt;When the function returns value =0, it means there is no need to change the sort order since the two values are same.&lt;/li&gt;
&lt;/ul&gt;&lt;pre class="brush:javascript"&gt;$(document).ready(function() {
  var list= [ 45, 32, 98, 24, 16, 9, 3];
  $('#allnumber').html(list.join(""));
  list = list.sort(function(a,b){
        return a-b;
    });
  $('#sorted').html(list.join(""));
})
&lt;/pre&gt;&lt;b&gt;See result below.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe style="width: 100%; height: 370px" src="http://jsfiddle.net/jquerybyexample/y6qgQ/embedded/result,js,html" allowfullscreen="allowfullscreen" frameborder="1"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See Complete &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/y6qgQ/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;Hope you find this post useful.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Credit : jQuery Recipes&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-8848037488351199920?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/YGUlc-mXvXM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/YGUlc-mXvXM/difference-between-sorting-string-array.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/01/difference-between-sorting-string-array.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-7252230642258378803</guid><pubDate>Mon, 09 Jan 2012 05:30:00 +0000</pubDate><atom:updated>2012-01-09T11:00:03.550+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Jquery Code Snippets</category><category domain="http://www.blogger.com/atom/ns#">jQuery Tips</category><category domain="http://www.blogger.com/atom/ns#">jQuery Codes</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><category domain="http://www.blogger.com/atom/ns#">jQuery Code Examples</category><title>How to check textbox is readonly using jQuery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Previously I had posted about "&lt;a href="http://jquerybyexample.blogspot.com/2010/06/make-readonly-textbox-using-jquery.html"&gt;&lt;b&gt;How to make textbox readonly using jQuery&lt;/b&gt;&lt;/a&gt;". One of way is to make textbox readonly is to set "readonly" attribute to true. So use the same attribute "readonly" to find out whether textbox is readonly or not using jQuery.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function(){
    $("#txtReadonly").attr('readonly', true);
    var isReadonly = $("#txtReadonly").attr('readonly');
    alert('txtReadonly is not readonly ' + isReadonly);
    var isNotReadonly = $("#txtNotReadonly").attr('readonly');
    alert('txtNotReadonly is not readonly ' + isNotReadonly);
});
&lt;/pre&gt;&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See live &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/Jh42c/" target="_blank"&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;Demo&lt;/span&gt;&lt;/a&gt;&lt;/b&gt; and &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/Jh42c/" target="_blank"&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;.   &lt;/div&gt;&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-7252230642258378803?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/rH9XNANmLL4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/rH9XNANmLL4/how-to-check-textbox-is-readonly-using.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/01/how-to-check-textbox-is-readonly-using.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-8686451038398837735</guid><pubDate>Thu, 05 Jan 2012 02:30:00 +0000</pubDate><atom:updated>2012-01-05T22:37:20.474+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery CDN</category><category domain="http://www.blogger.com/atom/ns#">jQuery Tips</category><category domain="http://www.blogger.com/atom/ns#">jQuery</category><title>Why to use Google hosted jQuery CDN</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
&lt;b&gt;Google&lt;/b&gt; is sea of free services. Do you know that &lt;b&gt;Google&lt;/b&gt; is also hosting &lt;b&gt;jQuery&lt;/b&gt; libraries on its &lt;b&gt; CDN(Content delivery network)&lt;/b&gt; and allows any website to use it for free. But why to use &lt;b&gt; Google hosted jQuery CDN&lt;/b&gt;?&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-Cgxd5ORy65s/TwXYm6Ya_cI/AAAAAAAABnc/pxMNPeBtZ-4/s1600/Why+Google++Hosted+jQuery+CDN.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="211" src="http://4.bp.blogspot.com/-Cgxd5ORy65s/TwXYm6Ya_cI/AAAAAAAABnc/pxMNPeBtZ-4/s400/Why+Google++Hosted+jQuery+CDN.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h3&gt;
Advantage:&lt;/h3&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Caching: The most important benefit is caching. If any previously visited site by user is using jQuery from Google CDN then the cached version will be used. It will not be downloaded again.&lt;/li&gt;
&lt;li&gt;Reduce Load: It reduces the load on your web server as it downloads from Google server's.&lt;/li&gt;
&lt;li&gt;Serves fast : You will be also benefitted from speed point of view. As Google has dozen's of different servers around the web and it will download the jQuery from whichever server is closer to the user. Google's CDN has a very low latency, it can serve a resource faster than your webserver can.&lt;/li&gt;
&lt;li&gt;Parellel Downloading: As the js file is on a separate domain, modern browsers will download the script in parallel with scripts on your domain.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h3&gt;
How to use it?&lt;/h3&gt;
&lt;br /&gt;
There are 2 ways to load from Google CDN.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Method 1:&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;&amp;lt;script  type="text/javascript"
    src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&amp;gt;
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Method 2&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;&amp;lt;script src="http://www.google.com/jsapi" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;&amp;lt;!--
google.load("jquery", "1.7.1");
google.setOnLoadCallback(function() {
// Place init code here instead of $(document).ready()
});
// --&amp;gt;
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;h3&gt;
What if Google CDN is down?&lt;/h3&gt;
&lt;br /&gt;
It is a good idea to use CDN but what if the CDN is down (rare possibility though) but you never know in this world as anything can happen. So if you have loaded your jQuery from any CDN and it went down then your jQuery code will stop working and your client will start shouting.&lt;br /&gt;
&lt;br /&gt;
Hang on, there is a solution for this as well. Below given jQuery code checks whether jQuery is loaded from Google CDN or not, if not then it references the jQuery.js file from your folder.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;&amp;lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;
if (typeof jQuery == 'undefined')
{
  document.write(unescape("%3Cscript src='Scripts/jquery.1.7.1.min.js' type='text/javascript'%3E%3C/script%3E"));
}
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
It first loads the jQuery from Google CDN and then check the jQuery object. If jQuery is not loaded successfully then it will references the jQuery.js file from hard drive location. In this example, the jQuery.js is loaded from Scripts folder.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Few quick tips&lt;/h3&gt;
&lt;br /&gt;
If you want jQuery 1.7.1 you can use a url like this:&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js&lt;/pre&gt;
Suppose you want to use latest version of  1.7 release,&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js&lt;/pre&gt;
If you always want to refer the latest version of jQuery,&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js&lt;/pre&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-8686451038398837735?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/fReZ-SS6GKo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/fReZ-SS6GKo/why-to-use-google-hosted-jquery-cdn.html</link><author>noreply@blogger.com (Virendra Dugar)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-Cgxd5ORy65s/TwXYm6Ya_cI/AAAAAAAABnc/pxMNPeBtZ-4/s72-c/Why+Google++Hosted+jQuery+CDN.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/01/why-to-use-google-hosted-jquery-cdn.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7148860988886047724.post-5383782622686381733</guid><pubDate>Tue, 03 Jan 2012 02:30:00 +0000</pubDate><atom:updated>2012-02-07T17:49:14.469+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery Tips</category><category domain="http://www.blogger.com/atom/ns#">jQuery Codes</category><category domain="http://www.blogger.com/atom/ns#">Validation</category><category domain="http://www.blogger.com/atom/ns#">jQuery 1.6</category><title>jQuery validation using class ".required" problem - Question from blog reader</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 14px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;Read &lt;b&gt;&lt;a href="http://jquerybyexample.blogspot.in/2011/04/validate-email-address-using-jquery.html" target="_blank"&gt;&lt;span style="color: #990000;"&gt;How to Validate email address using jQuery&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;Well, 5 days back I received an mail from one of my reader, in which he had written that &lt;b&gt;&lt;i&gt;"I need to validation html page using Jquery by looping through Class attributes ["Class=Required"] if the label attribute contain "required" class then i should validate the alert the user "Please Enter your value" and set back the focus to null control to enter the value. Please suggest how to do this in Jquery coding".&lt;br /&gt;
&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="color: purple;"&gt;Note: &lt;i&gt;I did not write the name of the blog reader because I am not sure if he wants his name here or not.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
He has a single HTML form with inputs like Name, Company, Job Title, Phone and Email. And on click of Submit, he wanted to validate the inputs which has "class=required". So I have created a demo page for his problem and send him the solution. &lt;br /&gt;
&lt;br /&gt;
Below is the jQuery code, which solves his problem. On click of Submit button, it iterates through all the input type which has ".required" class. And checks the value, if it is empty then display an alert and set focus to the textbox.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function(){
    $('#btnSubmit').click(function(){
        $("input.required").each(function(){
            if($(this).val().length == 0)
            {
               alert('Please Enter your value');
               $(this).focus(); 
               return false;
            }
        });
        //else submit your form.
    });
});
&lt;/pre&gt;&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See live &lt;span style="color: #990000;"&gt;&lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/Jqy3M/" target="_blank"&gt;Demo&lt;/a&gt;&lt;/b&gt; &lt;/span&gt;and &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/Jqy3M/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;Then very next day I received another email from him saying &lt;b&gt;&lt;i&gt;" I need to achieve through JQuery Validation, &amp;lt;Label&amp;gt; tag has the "class.required" attributes not the &amp;lt;Input&amp;gt; tag, those lable tag(s) has the "class.required" attributes only those needs to validates during use click the comman button and this JQuery script should be used globally across the website."&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
So his problem was the label tag is having the class "required", not the input tag. The solution which I have provided to him assuming that input tags has the required class as he has not mentioned that the label tag has the ".required" class in his first email. In his next email, he had also sent me the HTML code. First take a look at HTML code. (I have not put the whole code.)&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;&amp;lt;div class="formField"&amp;gt;
   &amp;lt;label for="txtFullName" class="required"&amp;gt;Name&amp;lt;/label&amp;gt; 
   &amp;lt;input id="txtFullName"  type="text" name="Full_Name" /&amp;gt;   
&amp;lt;/div&amp;gt;
&lt;/pre&gt;He was using class ".reuqired" with label along with HTML &lt;a href="http://www.w3schools.com/tags/att_label_for.asp" target="_blank"&gt;for&lt;/a&gt; attribute. The for attribute specifies which form element a label is bound to. So it put me in thoughts for 2 mins but I found a solution. This time, I was iterating through all the label which has ".required" class. And also getting the value of for attribute. As the for attribute value is same as the textbox id. So based on the for attribute value, I created object using &lt;a href="http://jquerybyexample.blogspot.com/2011/05/jquery-selectors-examples.html" target="_blank"&gt;&lt;b&gt;jQuery selectors&lt;/b&gt;&lt;/a&gt;. And rest is equal to previous solution.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$(document).ready(function(){
    $('#btnSubmit').click(function(){
        var bSubmit = true;
        $("label.required").each(function(){
            var txtAttrb = $(this).attr('for');
            if(txtAttrb.length &amp;gt; 0)
            {
                var txtVal = $("input[id=" + txtAttrb + "]");
                if(txtVal.val().length == 0)
                {
                   alert('Please Enter your value');
                   txtVal.focus(); 
                   bSubmit = false;
                   return false;
                }
            }
        });
        
        if(bSubmit == true)
        {
            //submit the form.
        }
    });
});
&lt;/pre&gt;&lt;div style="background: #FFFFE0; border: 1px solid #E6DB55; font-size: 20px; margin: 16px 0; padding: 5px 0 5px 10px;"&gt;See live &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/dmGvy/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Demo&lt;/span&gt;&lt;/a&gt;&lt;/b&gt; and &lt;b&gt;&lt;a href="http://jsfiddle.net/jquerybyexample/dmGvy/" target="_blank"&gt;&lt;span style="color: #990000;"&gt;Code&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;Hope this helps you as well. If you are also stuck somewhere and need any help for jQuery, Please &lt;b&gt;&lt;a href="http://www.contactme.com/4ecc964be95bbc00010050a1?locale=en&amp;amp;r=http%3A%2F%2Fjquerybyexample.blogspot.com%2Fsearch%2Flabel%2FjQuery%2520Selectors&amp;amp;u=http%3A%2F%2Fjquerybyexample.blogspot.com%2F2011%2F05%2Fjquery-selectors-examples.html&amp;amp;f=4ecc964be95bbc00010050a1&amp;amp;ha=right&amp;amp;va=top&amp;amp;tx=Contact%20Us&amp;amp;c=003C68&amp;amp;vid=1349dc84bc9a9bb"&gt;contact us.&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Feel free to contact me for any help related to jQuery, I will gladly help you.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7148860988886047724-5383782622686381733?l=jquerybyexample.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JqueryByExample/~4/JqucQqwtg5g" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/JqueryByExample/~3/JqucQqwtg5g/jquery-validation-using-class-required.html</link><author>noreply@blogger.com (Virendra Dugar)</author><thr:total>0</thr:total><feedburner:origLink>http://jquerybyexample.blogspot.com/2012/01/jquery-validation-using-class-required.html</feedburner:origLink></item></channel></rss>

