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

<channel>
	<title>jquery functions &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/tag/jquery-functions/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Wed, 11 Jul 2018 16:27:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>jquery functions &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Find Browser And Browser Version Using jQuery</title>
		<link>https://sibeeshpassion.com/find-browser-and-browser-version-using-jquery/</link>
					<comments>https://sibeeshpassion.com/find-browser-and-browser-version-using-jquery/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 21 Oct 2015 00:17:20 +0000</pubDate>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Find Browser And Browser Version Using jQuery]]></category>
		<category><![CDATA[jQuery Browser]]></category>
		<category><![CDATA[jquery functions]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10805</guid>

					<description><![CDATA[In this post we will see how we can find out the browser name and browser version by using jQuery. Here we will be using $.browser property og jQuery which returns the browser information. In this demo we will test this in most used browsers like Internet Explorer, Mozilla, Chrome, Opera. I hope you will like this. NB: Using $.browser is not recommended by jQuery itself, so that this feature has been moved to the jQuery.migrate plugin which is available to download if the user want. It is a vulnerable practice to use the same. Use it only if needed. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can find out the browser name and browser version by using jQuery. Here we will be using $.browser property og jQuery which returns the browser information. In this demo we will test this in most used browsers like Internet Explorer, Mozilla, Chrome, Opera. I hope you will like this.</p>
<blockquote><p>NB: Using $.browser is not recommended by jQuery itself, so that this feature has been moved to the jQuery.migrate plugin which is available to download if the user want. It is a vulnerable practice to use the same. Use it only if needed. It is always better to do not use browser specific codes. </p></blockquote>
<p><strong>Using the code</strong></p>
<p>First thing you need to do is create a page.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Find Browser In JQuery &#8211; Sibeesh Passion&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    Find Browser In JQuery &#8211; Sibeesh Passion<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Then you need to include the script needed.</p>
<p>[js]<br />
&lt;script src=&quot;http://sibeeshpassion.com/content/scripts/jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://code.jquery.com/jquery-migrate-1.2.1.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>As you have noticed I have included <em>http://code.jquery.com/jquery-migrate-1.2.1.js</em>. It is just because this feature is deprecated and moved to this js. </p>
<p>Now you need to write the scripts.</p>
<p>[js]<br />
&lt;script&gt;<br />
        $(document).ready(function () {<br />
            if ($.browser.webkit) {<br />
                alert(&quot;Hooray WebKit!&quot; +&quot; Version: &quot;+ $.browser.version);<br />
            } else if ($.browser.msie) {<br />
                alert(&quot;Hooray IE!&quot; + &quot; Version: &quot; + $.browser.version);<br />
            } else if ($.browser.mozilla) {<br />
                alert(&quot;Hooray mozilla!&quot; + &quot; Version: &quot; + $.browser.version);<br />
            }<br />
            $.each($.browser, function (i, val) {<br />
                $(&quot;&lt;div&gt;&quot; + i + &quot; : &lt;span&gt;&quot; + val + &quot;&lt;/span&gt;&quot;)<br />
                .appendTo(document.body);<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>We are appending the browser details to the DOM. So that it is always better to use some CSS to improve the readability.</p>
<p>[css]<br />
 &lt;style&gt;<br />
        div {<br />
            width: 500px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            color: #f90;<br />
            font-style: oblique;<br />
            text-align: center;<br />
        }<br />
    &lt;/style&gt;<br />
[/css]</p>
<p>Now please run your browser, you can see the following output. </p>
<div id="attachment_10806" style="width: 427px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-10806" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery.png" alt="Find Browser And Browser Version Using jQuery" width="417" height="243" class="size-full wp-image-10806" srcset="/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery.png 417w, /wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery-300x175.png 300w, /wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery-400x233.png 400w" sizes="(max-width: 417px) 100vw, 417px" /></a><p id="caption-attachment-10806" class="wp-caption-text">Find Browser And Browser Version Using jQuery</p></div>
<div id="attachment_10807" style="width: 624px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery1.png"><img decoding="async" aria-describedby="caption-attachment-10807" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery1.png" alt="Find Browser And Browser Version Using jQuery" width="614" height="238" class="size-full wp-image-10807" srcset="/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery1.png 614w, /wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery1-300x116.png 300w, /wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery1-400x155.png 400w" sizes="(max-width: 614px) 100vw, 614px" /></a><p id="caption-attachment-10807" class="wp-caption-text">Find Browser And Browser Version Using jQuery</p></div>
<div id="attachment_10808" style="width: 577px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery2.png"><img decoding="async" aria-describedby="caption-attachment-10808" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery2.png" alt="Find Browser And Browser Version Using jQuery" width="567" height="199" class="size-full wp-image-10808" srcset="/wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery2.png 567w, /wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery2-300x105.png 300w, /wp-content/uploads/2015/10/Find_Browser_And_Browser_Version_Using_jQuery2-400x140.png 400w" sizes="(max-width: 567px) 100vw, 567px" /></a><p id="caption-attachment-10808" class="wp-caption-text">Find Browser And Browser Version Using jQuery</p></div>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Find Browser In JQuery &#8211; Sibeesh Passion&lt;/title&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://code.jquery.com/jquery-migrate-1.2.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script&gt;<br />
        $(document).ready(function () {<br />
            if ($.browser.webkit) {<br />
                alert(&quot;Hooray WebKit!&quot; +&quot; Version: &quot;+ $.browser.version);<br />
            } else if ($.browser.msie) {<br />
                alert(&quot;Hooray IE!&quot; + &quot; Version: &quot; + $.browser.version);<br />
            } else if ($.browser.mozilla) {<br />
                alert(&quot;Hooray mozilla!&quot; + &quot; Version: &quot; + $.browser.version);<br />
            }<br />
            $.each($.browser, function (i, val) {<br />
                $(&quot;&lt;div&gt;&quot; + i + &quot; : &lt;span&gt;&quot; + val + &quot;&lt;/span&gt;&quot;)<br />
                .appendTo(document.body);<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
    &lt;style&gt;<br />
        div {<br />
            width: 500px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            color: #f90;<br />
            font-style: oblique;<br />
            text-align: center;<br />
        }<br />
    &lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    Find Browser In JQuery &#8211; Sibeesh Passion<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Have you ever wanted to find out the browser details in client side? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/find-browser-and-browser-version-using-jquery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Overwrite CSS Styles Using addClass In JQuery</title>
		<link>https://sibeeshpassion.com/overwrite-css-styles-using-addclass-in-jquery/</link>
					<comments>https://sibeeshpassion.com/overwrite-css-styles-using-addclass-in-jquery/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 21 Oct 2015 00:06:18 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JQuery addClass]]></category>
		<category><![CDATA[jquery functions]]></category>
		<category><![CDATA[Overwrite CSS Styles]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10811</guid>

					<description><![CDATA[In this post we will see how we can overwrite CSS styles using addClass method in jQuery. We have so many options to change the styles of a particular element. We can do it by editing the style sheet manually. But what if you want to do the same dynamically? If you need to change a CSS property dynamically, I suggest you to read it here: CSS Important . In this post we are applying more CSS rules to the same element. I hope you will like this. Here I am using jQuery 2.0.2 version, you can use whichever version [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can overwrite <a href="http://sibeeshpassion.com/category/css/" target="_blank">CSS </a>styles using addClass method in jQuery. We have so many options to change the styles of a particular element. We can do it by editing the style sheet manually. But what if you want to do the same dynamically? If you need to change a CSS property dynamically, I suggest you to read it here: <a href="http://sibeeshpassion.com/apply-css-important-in-jquery-and-css/" target="_blank">CSS Important </a>. In this post we are applying more CSS rules to the same element. I hope you will like this.</p>
<blockquote><p>Here I am using jQuery 2.0.2 version, you can use whichever version you like. </p></blockquote>
<p><strong>Background</strong></p>
<p>Recently I have got a requirement of changing a CSS property of an element which is common for element. So I wanted to change the CSS property only if my condition becomes true. In this situation I used jQuery addClass to do this requirement. Here I will show you how. </p>
<p><strong>Using the code</strong></p>
<p>First thing you need to do is create a page.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;AddClass JQuery Demo &#8211; Sibeesh Passion&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
   AddClass JQuery Demo &#8211; Sibeesh Passion<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Then you need to include the script needed.</p>
<p>[js]<br />
&lt;script src=&quot;http://sibeeshpassion.com/content/scripts/jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Now you need to write the scripts.</p>
<p>[js]<br />
&lt;script&gt;<br />
        $(document).ready(function () {<br />
            setTimeout(function () {<br />
				$(&#8216;.first&#8217;).addClass(&#8216;second&#8217;);<br />
			}, 5000);<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>We are adding a new CSS style <em>second </em> to a class <em>first </em>. We will add this after five seconds of document ready. So now we need to create the styles right?</p>
<p>[css]<br />
  &lt;style&gt;<br />
        .first {<br />
            width: 100px;<br />
	    height: 100px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            font-style: oblique;<br />
            text-align: center;<br />
			background:green;<br />
        }<br />
	.second {<br />
            width: 200px;<br />
	    height: 200px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            background: blue;<br />
            font-style: oblique;<br />
            text-align: center;<br />
        }<br />
    &lt;/style&gt;<br />
[/css]</p>
<p>Now please run your browser, you can see the following output. </p>
<div id="attachment_10812" style="width: 303px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Overwrite_CSS_Styles.png"><img decoding="async" aria-describedby="caption-attachment-10812" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Overwrite_CSS_Styles.png" alt="Overwrite CSS Styles Using addClass" width="293" height="181" class="size-full wp-image-10812" /></a><p id="caption-attachment-10812" class="wp-caption-text">Overwrite CSS Styles Using addClass</p></div>
<p>Now after five seconds, the same element will look as follows.</p>
<div id="attachment_10813" style="width: 324px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Overwrite_CSS_Styles1.png"><img decoding="async" aria-describedby="caption-attachment-10813" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Overwrite_CSS_Styles1.png" alt="Overwrite CSS Styles Using addClass" width="314" height="298" class="size-full wp-image-10813" srcset="/wp-content/uploads/2015/10/Overwrite_CSS_Styles1.png 314w, /wp-content/uploads/2015/10/Overwrite_CSS_Styles1-300x285.png 300w" sizes="(max-width: 314px) 100vw, 314px" /></a><p id="caption-attachment-10813" class="wp-caption-text">Overwrite CSS Styles Using addClass</p></div>
<p>If you look at your browser console, you can see both of the styles are applied to the element. </p>
<div id="attachment_10814" style="width: 610px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Overwrite_CSS_Styles2.png"><img decoding="async" aria-describedby="caption-attachment-10814" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Overwrite_CSS_Styles2.png" alt="Overwrite CSS Styles Using addClass" width="600" height="626" class="size-full wp-image-10814" srcset="/wp-content/uploads/2015/10/Overwrite_CSS_Styles2.png 600w, /wp-content/uploads/2015/10/Overwrite_CSS_Styles2-288x300.png 288w, /wp-content/uploads/2015/10/Overwrite_CSS_Styles2-400x417.png 400w, /wp-content/uploads/2015/10/Overwrite_CSS_Styles2-575x600.png 575w" sizes="(max-width: 600px) 100vw, 600px" /></a><p id="caption-attachment-10814" class="wp-caption-text">Overwrite CSS Styles Using addClass</p></div>
<p>That&#8217;s all, now we can see the complete code here.</p>
<blockquote><p>Here I am using setTimeout as my condition, you can use any condition according to your requirement. </p></blockquote>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;AddClass JQuery Demo &#8211; Sibeesh Passion&lt;/title&gt;<br />
    &lt;script src=&quot;http://sibeeshpassion.com/content/scripts/jquery-2.0.2.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script&gt;<br />
        $(document).ready(function () {<br />
            setTimeout(function () {<br />
				$(&#8216;.first&#8217;).addClass(&#8216;second&#8217;);<br />
			}, 5000);<br />
        });<br />
    &lt;/script&gt;<br />
    &lt;style&gt;<br />
        .first {<br />
            width: 100px;<br />
			height: 100px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            font-style: oblique;<br />
            text-align: center;<br />
			background:green;<br />
        }<br />
		.second {<br />
            width: 200px;<br />
			height: 200px;<br />
            border: 1px solid #ccc;<br />
            border-radius: 5px;<br />
            padding: 10px;<br />
            margin: 10px;<br />
            box-shadow: 1px 1px 1px #999;<br />
            background: blue;<br />
            font-style: oblique;<br />
            text-align: center;<br />
        }<br />
    &lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    AddClass JQuery Demo &#8211; Sibeesh Passion<br />
	&lt;div class=&quot;first&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Have you ever wanted to do this requirement? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/overwrite-css-styles-using-addclass-in-jquery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Get The Current URL in jQuery</title>
		<link>https://sibeeshpassion.com/get-the-current-url-in-jquery/</link>
					<comments>https://sibeeshpassion.com/get-the-current-url-in-jquery/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 12 Oct 2015 13:13:40 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Get The Current URL in jQuery]]></category>
		<category><![CDATA[jquery functions]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10803</guid>

					<description><![CDATA[In this post we will see how we can get the current URL in jQuery [js] &#60;script&#62; $(document).ready(function ($) { alert(window.location); }); &#60;/script&#62; [/js] Here window.location will return the current location/url of your browser. Please see my other posts related to JQuery here: JQuery Posts Kindest Regards Sibeesh Venu]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can get the current URL in <a href="http://sibeeshpassion.com/category/jquery" target="_blank">jQuery</a></p>
<p>[js]<br />
 &lt;script&gt;<br />
        $(document).ready(function ($) {<br />
            alert(window.location);<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>Here window.location will return the current location/url of your browser.</p>
<p>Please see my other posts related to JQuery here: <a href="http://sibeeshpassion.com/tag/jquery/" target="_blank">JQuery Posts</a></p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/get-the-current-url-in-jquery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A Drag And Drop Game</title>
		<link>https://sibeeshpassion.com/a-drag-and-drop-game/</link>
					<comments>https://sibeeshpassion.com/a-drag-and-drop-game/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 20 Aug 2015 10:12:02 +0000</pubDate>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Drag And Drop Game]]></category>
		<category><![CDATA[JQuery Drag]]></category>
		<category><![CDATA[JQuery Drop]]></category>
		<category><![CDATA[jquery functions]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=9831</guid>

					<description><![CDATA[[toc] Introduction In this post, we will create a drag and drop game which uses jquery drag drop functions. We will create two boxes, from one box we need to drag the content box and drop the same into another box. We will be using sortable function and its events. I hope you will like this game. Background For the last Independence day for India, I though to create a game related to the word &#8220;INDIA&#8221;. I created and hosted it in my website. Using the code First we will create an html5 page as follows. [html] &#60;!DOCTYPE html&#62; &#60;html&#62; [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h2>Introduction</h2>
<p>In this post, we will create a drag and drop game which uses <a href="http://sibeeshpassion.com/tag/jquery/" target="_blank" rel="noopener">jquery</a> drag drop functions. We will create two boxes, from one box we need to drag the content box and drop the same into another box. We will be using sortable function and its events. I hope you will like this game.</p>
<h2><strong>Background</strong></h2>
<p>For the last <em>Independence day for India</em>, I though to create a game related to the word &#8220;INDIA&#8221;. I created and hosted it in my website.</p>
<h2><strong>Using the code</strong></h2>
<p>First we will create an <a href="http://sibeeshpassion.com/tag/html5/" target="_blank" rel="noopener">html5 </a>page as follows.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Find INDIA Game &#8211; Sibeesh Passion&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body id=&#8221;body&#8221;&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>And now we will set style to the body. <a href="http://sibeeshpassion.com/make-image-fit-to-the-screen/" target="_blank" rel="noopener">To set the background image fit to the screen</a> we will use the following styles.</p>
<p>[css]<br />
#body {<br />
background: url(&#8220;http://sibeeshpassion.com/content/images/indian%20flag%20banner.jpg&#8221;) no-repeat center center fixed;<br />
-webkit-background-size: cover;<br />
-moz-background-size: cover;<br />
-o-background-size: cover;<br />
background-size: cover;<br />
}<br />
[/css]</p>
<p>Now we can see page as follows.</p>
<div id="attachment_9841" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/FindIndiaImage-e1439998028998.png"><img decoding="async" aria-describedby="caption-attachment-9841" class="size-large wp-image-9841" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/FindIndiaImage-1024x536.png" alt="Make Image Fit To The Screen" width="634" height="332" /></a><p id="caption-attachment-9841" class="wp-caption-text">Make Image Fit To The Screen</p></div>
<p>Since we are going to create a client side game, it is necessary to load the jquery and jquery ui reference.</p>
<p>[js]<br />
&lt;script src=&#8221;jquery-2.0.2.min.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;jquery-ui.js&#8221;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Next we will create the drag able contents as follows.</p>
<p>[html]<br />
&lt;div class=&#8221;dragDiv&#8221;&gt;<br />
&lt;div id=&#8221;dragDivInner&#8221;&gt;<br />
&lt;div myid=&#8221;1&#8243; class=&#8221;droppable&#8221; myval=&#8221;I&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;2&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;3&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;6&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;7&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;8&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;9&#8243; class=&#8221;droppable&#8221; myval=&#8221;N&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;10&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;11&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;12&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;17&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;18&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;19&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;20&#8243; class=&#8221;Notdroppable&#8221; myval=&#8221;A&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;21&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;22&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;23&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;24&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;25&#8243; class=&#8221;Notdroppable&#8221; myval=&#8221;I&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;26&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;27&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;28&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;29&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;30&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;31&#8243; class=&#8221;Notdroppable&#8221; myval=&#8221;D&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;32&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;33&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;34&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;35&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;40&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
[/html]</p>
<p>Now we need to set a div where we can drag contents to it.</p>
<p>[html]<br />
&lt;div class=&#8221;dropDiv&#8221;&gt;<br />
&lt;div id=&#8221;draggedContent&#8221; style=&#8221;display: none;&#8221;&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
[/html]</p>
<p>As it is a game, we must set the game rules also right?</p>
<p>[html]<br />
&lt;div id=&#8221;gamerules&#8221;&gt;<br />
&lt;ul&gt;<br />
&lt;li class=&#8221;caption&#8221;&gt;Find &#8220;INDIA&#8221; Game Rules &lt;/li&gt;<br />
&lt;li&gt;You can drag and drop any boxes. &lt;/li&gt;<br />
&lt;li&gt;We have set each letters from &#8220;INDIA&#8221; in the boxes. It is hidden&lt;/li&gt;<br />
&lt;li&gt;The game is, you need to find out the letters of &#8220;INDIA&#8221; by drag and drop the boxes to nearest box&lt;/li&gt;<br />
&lt;li&gt;Let us play the game now&#8230;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;<br />
[/html]</p>
<p>And we will set some styles to those elements.</p>
<p>[css]<br />
.dropDiv {<br />
border: 1px solid #ccc;<br />
width: 25%;<br />
height: auto;<br />
padding: 10px;<br />
display: inline;<br />
position: absolute;<br />
margin-left: 5px;<br />
min-height: 265px;<br />
}</p>
<p>.dragDiv {<br />
border: 1px solid #ccc;<br />
width: 27%;<br />
height: auto;<br />
padding: 10px;<br />
float: left;<br />
margin-left: 5px;<br />
min-height: 265px;<br />
}</p>
<p>#parent {<br />
/*border: 1px solid #ccc;*/<br />
height: 307px;<br />
width: 70%;<br />
padding: 20px;<br />
}</p>
<p>.droppable {<br />
width: 25px;<br />
height: 28px;<br />
padding: 5px;<br />
background-color: green;<br />
margin: 3px;<br />
float: left;<br />
cursor: move;<br />
}</p>
<p>.Notdroppable {<br />
width: 25px;<br />
height: 28px;<br />
padding: 5px;<br />
background-color: red;<br />
margin: 3px;<br />
float: left;<br />
}</p>
<p>#countdiv {<br />
margin-top: 10px;<br />
float: left;<br />
}</p>
<p>#gamerules {<br />
border: 1px solid #ccc;<br />
width: 250px;<br />
height: 280px;<br />
padding: 5px;<br />
float: right;<br />
margin-left: 5px;<br />
}</p>
<p>.caption {<br />
list-style: none;<br />
color: green;<br />
padding: 5px;<br />
font-weight: bold;<br />
}<br />
[/css]</p>
<p>So our page will look like as follows.</p>
<div id="attachment_9971" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/Drag-And-Drop-Game12-e1440056905942.png"><img decoding="async" aria-describedby="caption-attachment-9971" class="size-full wp-image-9971" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/Drag-And-Drop-Game12-e1440056905942.png" alt="Drag And Drop Game" width="650" height="363" srcset="/wp-content/uploads/2015/08/Drag-And-Drop-Game12-e1440056905942.png 650w, /wp-content/uploads/2015/08/Drag-And-Drop-Game12-e1440056905942-300x168.png 300w, /wp-content/uploads/2015/08/Drag-And-Drop-Game12-e1440056905942-400x223.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-9971" class="wp-caption-text">Drag And Drop Game</p></div>
<p>The next thing what we need to do is adding sortable functionality using <em>jquery sortable</em> to the div which has class as dropDiv.</p>
<p>[js]<br />
$(&#8220;.dropDiv&#8221;).sortable({<br />
connectWith: &#8216;.dropDiv&#8217;,<br />
forcePlaceholderSize: true,<br />
forceHelperSize: true,<br />
opacity: 0.60,<br />
placeholder: &#8216;placeholder&#8217;,<br />
tolerance: &#8216;touch&#8217;,<br />
scroll: false,<br />
cancel: &#8216;.dropDiv&#8217;,<br />
start: function (event, ui) {<br />
},<br />
stop: function (event, ui) {<br />
},<br />
update: function (event, ui) {<br />
},<br />
receive: function (event, ui) {<br />
}<br />
});<br />
[/js]</p>
<p>Please be noted that we have given connectWith property as follows to make the drag able div to be dropped only in the div which has class as dropDiv.</p>
<p>[js]<br />
connectWith: &#8216;.dropDiv&#8217;<br />
[/js]</p>
<p>We have also set the property cancel as follows to make the dropped div not drag able from dropDiv.</p>
<p>[js]<br />
cancel: &#8216;.dropDiv&#8217;,<br />
[/js]</p>
<p>Next we will set draggable for our inner divs.</p>
<p>[js]<br />
$(&#8216;.Notdroppable,.droppable&#8217;).draggable({<br />
connectToSortable: &#8216;.dropDiv&#8217;,<br />
containment: &#8220;#dropDiv&#8221;,<br />
helper: &#8216;clone&#8217;,<br />
revert: &#8216;invalid&#8217;<br />
});<br />
[/js]</p>
<h3><strong>Game Insights</strong></h3>
<p>As you can see in the html of the our dragDiv, we have set an attribute <em>myval</em> for some of the div. So what we are going to do is when a user drags a div we will check whether that particular div has that attribute and if it has, user got one letter. In this way user needs to collect 5 letters from the dragDiv.</p>
<p>So in the <em>stop</em> function of sortable we will write some scripts as follows.</p>
<p>[js]<br />
stop: function (event, ui) {<br />
++count;<br />
if (ui.item.attr(&#8216;myval&#8217;)) {<br />
$(&#8216;#draggedContent&#8217;).show().append(ui.item.attr(&#8216;myval&#8217;));<br />
}<br />
$(&#8220;.dragDiv div[myid=&#8221; + ui.item.attr(&#8216;myid&#8217;) + &#8220;]&#8221;).remove();<br />
var res = maxTrial &#8211; count;<br />
if (res == 0) {<br />
$(&#8216;#countdiv&#8217;).show().html(&#8216;Sorry, you have no more chances left!!!. Please refresh to start the game again&#8217;);<br />
$(&#8216;.dragDiv .droppable, .dragDiv .Notdroppable&#8217;).remove();<br />
} else {<br />
$(&#8216;#countdiv&#8217;).show().html(&#8216;You still have &#8216; + res + &#8216; tries&#8217;);<br />
}<br />
$(&#8216;.dropDiv .droppable, .dropDiv .Notdroppable&#8217;).remove();<br />
if ($(&#8216;#draggedContent&#8217;).html().length == 5) {<br />
alert(&#8216;You have won the game!!!. Please collect the prize from somewhere ;)&#8217;);<br />
$(&#8216;#countdiv&#8217;).show().html(&#8216;You have won the game!!!. Please collect the prize from somewhere ;)!. Please refresh to start the game again&#8217;);<br />
$(&#8216;.dragDiv .droppable, .dragDiv .Notdroppable&#8217;).remove();<br />
}</p>
<p>}<br />
[/js]</p>
<p>We are <a href="http://sibeeshpassion.com/find-an-inner-div-which-has-a-particular-attribute-and-remove/" target="_blank" rel="noopener">checking whether the inner div has a particular attribute</a> as follows and once we find it, we are removing that from dragDiv.</p>
<p>[js]<br />
if (ui.item.attr(&#8216;myval&#8217;)) {<br />
$(&#8216;#draggedContent&#8217;).show().append(ui.item.attr(&#8216;myval&#8217;));<br />
}<br />
$(&#8220;.dragDiv div[myid=&#8221; + ui.item.attr(&#8216;myid&#8217;) + &#8220;]&#8221;).remove();<br />
[/js]</p>
<p>If a user has already got those five letters, we must alert the user right? We will do this validation in <em>stop </em>function.</p>
<p>[js]<br />
start: function (event, ui) {<br />
if (count &gt; maxTrial) {<br />
$(&#8216;#countdiv&#8217;).show().html(&#8216;Sorry, you have no more chances left!!!. Please refresh to start the game again&#8217;);<br />
} else {</p>
<p>}<br />
}<br />
[/js]</p>
<div id="attachment_9981" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/Drag_And_Drop_Game21-e1440063746818.png"><img decoding="async" aria-describedby="caption-attachment-9981" class="size-full wp-image-9981" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/Drag_And_Drop_Game21-e1440063746818.png" alt="Drag And Drop Game" width="650" height="241" srcset="/wp-content/uploads/2015/08/Drag_And_Drop_Game21-e1440063746818.png 650w, /wp-content/uploads/2015/08/Drag_And_Drop_Game21-e1440063746818-300x111.png 300w, /wp-content/uploads/2015/08/Drag_And_Drop_Game21-e1440063746818-400x148.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-9981" class="wp-caption-text">Drag And Drop Game</p></div>
<div id="attachment_9982" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/Drag_And_Drop_Game3-e1440063789835.png"><img decoding="async" aria-describedby="caption-attachment-9982" class="size-full wp-image-9982" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/Drag_And_Drop_Game3-e1440063789835.png" alt="Drag And Drop Game" width="650" height="215" srcset="/wp-content/uploads/2015/08/Drag_And_Drop_Game3-e1440063789835.png 650w, /wp-content/uploads/2015/08/Drag_And_Drop_Game3-e1440063789835-300x99.png 300w, /wp-content/uploads/2015/08/Drag_And_Drop_Game3-e1440063789835-400x132.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-9982" class="wp-caption-text">Drag And Drop Game</p></div>
<p>If there is no chances left, user will get a message as follows.</p>
<div id="attachment_9991" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/Drag_And_Drop_Game4-e1440063972976.png"><img decoding="async" aria-describedby="caption-attachment-9991" class="size-full wp-image-9991" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/Drag_And_Drop_Game4-e1440063972976.png" alt="Drag And Drop Game" width="650" height="224" srcset="/wp-content/uploads/2015/08/Drag_And_Drop_Game4-e1440063972976.png 650w, /wp-content/uploads/2015/08/Drag_And_Drop_Game4-e1440063972976-300x103.png 300w, /wp-content/uploads/2015/08/Drag_And_Drop_Game4-e1440063972976-400x138.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-9991" class="wp-caption-text">Drag And Drop Game</p></div>
<p>Now what we need to do next? Yes we need to shuffle div contents or elese user may find it easy when the tiles are in same order and in same place.</p>
<p><a href="http://sibeeshpassion.com/shuffle-div-contents/" target="_blank" rel="noopener">To shuffle the divs dynamically</a> we will add some scripts as follows.</p>
<p>[js]<br />
var parent = $(&#8220;#dragDivInner&#8221;);<br />
var divs = parent.children();<br />
while (divs.length) {<br />
parent.append(divs.splice(Math.floor(Math.random() * divs.length), 1)[0]);<br />
}<br />
[/js]</p>
<p>Next we will <a href="http://sibeeshpassion.com/how-to-disable-right-click-in-a-page-using-jquery/" target="_blank" rel="noopener">disable the right click and mouse events</a> as follows.</p>
<p>[js]<br />
document.onmousedown = function (event) {<br />
event = (event || window.event);<br />
if (event.keyCode == 123) {<br />
return false;<br />
}<br />
}<br />
document.onkeydown = function (event) {<br />
event = (event || window.event);<br />
if (event.keyCode == 123) {<br />
return false;<br />
}<br />
}<br />
$(document).on(&#8220;contextmenu&#8221;, function (e) {<br />
return false;<br />
});<br />
[/js]</p>
<p>We will also <a href="http://sibeeshpassion.com/how-to-disable-f12-key-in-a-page-using-jquery/" target="_blank" rel="noopener">disable the F12 key of keyboard</a>.</p>
<p>[js]<br />
document.onkeypress = function (event) {<br />
event = (event || window.event);<br />
if (event.keyCode == 123) {<br />
return false;<br />
}<br />
}<br />
[/js]</p>
<p>As every game has some settings, we will also give some settings.</p>
<p>[html]<br />
&lt;div id=&#8221;gameSettings&#8221;&gt;<br />
&lt;br /&gt;<br />
Select Game Level :<br />
&lt;select id=&#8221;selectGameLevel&#8221;&gt;<br />
&lt;option value=&#8221;Easy&#8221;&gt;Easy&lt;/option&gt;<br />
&lt;option value=&#8221;Medium&#8221;&gt;Medium&lt;/option&gt;<br />
&lt;option value=&#8221;Hard&#8221;&gt;Hard&lt;/option&gt;<br />
&lt;/select&gt;<br />
&lt;/div&gt;<br />
[/html]</p>
<p>And in the drop down option change we will decrease the maximum trials allowed.</p>
<p>[js]<br />
$(&#8220;#selectGameLevel&#8221;).change(function (e) {<br />
var selected = $(&#8220;#selectGameLevel option:selected&#8221;).val();<br />
if (selected == &#8220;Easy&#8221;) {<br />
maxTrial = 25;<br />
} else if (selected == &#8220;Medium&#8221;) {<br />
maxTrial = 15;<br />
} else if (selected == &#8220;Hard&#8221;) {<br />
maxTrial = 10;<br />
}<br />
});<br />
[/js]</p>
<p>So our complete page will look like this.</p>
<div id="attachment_10001" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/Drag_And_Drop_Game5-e1440065282400.png"><img decoding="async" aria-describedby="caption-attachment-10001" class="size-large wp-image-10001" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/Drag_And_Drop_Game5-1024x549.png" alt="Drag And Drop Game" width="634" height="340" /></a><p id="caption-attachment-10001" class="wp-caption-text">Drag And Drop Game</p></div>
<p>Our complete code is as follows.</p>
<h3><strong>Complete Code</strong></h3>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Find INDIA Game &#8211; Sibeesh Passion&lt;/title&gt;<br />
&lt;script src=&#8221;jquery-2.0.2.min.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script src=&#8221;jquery-ui.js&#8221;&gt;&lt;/script&gt;<br />
&lt;style&gt;<br />
#body {<br />
background: url(&#8220;http://sibeeshpassion.com/content/images/indian%20flag%20banner.jpg&#8221;) no-repeat center center fixed;<br />
-webkit-background-size: cover;<br />
-moz-background-size: cover;<br />
-o-background-size: cover;<br />
background-size: cover;<br />
}</p>
<p>.dropDiv {<br />
border: 1px solid #ccc;<br />
width: 25%;<br />
height: auto;<br />
padding: 10px;<br />
display: inline;<br />
position: absolute;<br />
margin-left: 5px;<br />
min-height: 265px;<br />
}</p>
<p>.dragDiv {<br />
border: 1px solid #ccc;<br />
width: 27%;<br />
height: auto;<br />
padding: 10px;<br />
float: left;<br />
margin-left: 5px;<br />
min-height: 265px;<br />
}</p>
<p>#parent {<br />
/*border: 1px solid #ccc;*/<br />
height: 307px;<br />
width: 70%;<br />
padding: 20px;<br />
}</p>
<p>.droppable {<br />
width: 25px;<br />
height: 28px;<br />
padding: 5px;<br />
background-color: green;<br />
margin: 3px;<br />
float: left;<br />
cursor: move;<br />
}</p>
<p>.Notdroppable {<br />
width: 25px;<br />
height: 28px;<br />
padding: 5px;<br />
background-color: red;<br />
margin: 3px;<br />
float: left;<br />
}</p>
<p>#countdiv {<br />
margin-top: 10px;<br />
float: left;<br />
}</p>
<p>#gamerules {<br />
border: 1px solid #ccc;<br />
width: 250px;<br />
height: 280px;<br />
padding: 5px;<br />
float: right;<br />
margin-left: 5px;<br />
}</p>
<p>.caption {<br />
list-style: none;<br />
color: green;<br />
padding: 5px;<br />
font-weight: bold;<br />
}</p>
<p>#gameSettings {<br />
width: auto;<br />
}<br />
&lt;/style&gt;<br />
&lt;script&gt;<br />
var count = 0;<br />
var maxTrial = 25;<br />
document.onkeypress = function (event) {<br />
event = (event || window.event);<br />
if (event.keyCode == 123) {<br />
return false;<br />
}<br />
}<br />
document.onmousedown = function (event) {<br />
event = (event || window.event);<br />
if (event.keyCode == 123) {<br />
return false;<br />
}<br />
}<br />
document.onkeydown = function (event) {<br />
event = (event || window.event);<br />
if (event.keyCode == 123) {<br />
return false;<br />
}<br />
}<br />
$(function () {<br />
$(document).on(&#8220;contextmenu&#8221;, function (e) {<br />
return false;<br />
});<br />
var parent = $(&#8220;#dragDivInner&#8221;);<br />
var divs = parent.children();<br />
while (divs.length) {<br />
parent.append(divs.splice(Math.floor(Math.random() * divs.length), 1)[0]);<br />
}<br />
$(&#8220;#selectGameLevel&#8221;).change(function (e) {<br />
var selected = $(&#8220;#selectGameLevel option:selected&#8221;).val();<br />
if (selected == &#8220;Easy&#8221;) {<br />
maxTrial = 25;<br />
} else if (selected == &#8220;Medium&#8221;) {<br />
maxTrial = 15;<br />
} else if (selected == &#8220;Hard&#8221;) {<br />
maxTrial = 10;<br />
}<br />
});<br />
$(&#8216;.Notdroppable,.droppable&#8217;).draggable({<br />
connectToSortable: &#8216;.dropDiv&#8217;,<br />
containment: &#8220;#dropDiv&#8221;,<br />
helper: &#8216;clone&#8217;,<br />
revert: &#8216;invalid&#8217;<br />
});<br />
$(&#8220;.dropDiv&#8221;).sortable({<br />
connectWith: &#8216;.dropDiv&#8217;,<br />
forcePlaceholderSize: true,<br />
forceHelperSize: true,<br />
opacity: 0.60,<br />
placeholder: &#8216;placeholder&#8217;,<br />
tolerance: &#8216;touch&#8217;,<br />
scroll: false,<br />
cancel: &#8216;.dropDiv&#8217;,<br />
start: function (event, ui) {<br />
if (count &gt; maxTrial) {<br />
$(&#8216;#countdiv&#8217;).show().html(&#8216;Sorry, you have no more chances left!!!. Please refresh to start the game again&#8217;);<br />
} else {</p>
<p>}<br />
},<br />
stop: function (event, ui) {<br />
++count;<br />
if (ui.item.attr(&#8216;myval&#8217;)) {<br />
$(&#8216;#draggedContent&#8217;).show().append(ui.item.attr(&#8216;myval&#8217;));<br />
}<br />
$(&#8220;.dragDiv div[myid=&#8221; + ui.item.attr(&#8216;myid&#8217;) + &#8220;]&#8221;).remove();<br />
var res = maxTrial &#8211; count;<br />
if (res == 0) {<br />
$(&#8216;#countdiv&#8217;).show().html(&#8216;Sorry, you have no more chances left!!!. Please refresh to start the game again&#8217;);<br />
$(&#8216;.dragDiv .droppable, .dragDiv .Notdroppable&#8217;).remove();<br />
} else {<br />
$(&#8216;#countdiv&#8217;).show().html(&#8216;You still have &#8216; + res + &#8216; tries&#8217;);<br />
}<br />
$(&#8216;.dropDiv .droppable, .dropDiv .Notdroppable&#8217;).remove();<br />
if ($(&#8216;#draggedContent&#8217;).html().length == 5) {<br />
alert(&#8216;You have won the game!!!. Please collect the prize from somewhere ;)&#8217;);<br />
$(&#8216;#countdiv&#8217;).show().html(&#8216;You have won the game!!!. Please collect the prize from somewhere ;)!. Please refresh to start the game again&#8217;);<br />
$(&#8216;.dragDiv .droppable, .dragDiv .Notdroppable&#8217;).remove();<br />
}</p>
<p>},<br />
update: function (event, ui) {<br />
},<br />
receive: function (event, ui) {<br />
}<br />
});<br />
});<br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body id=&#8221;body&#8221;&gt;<br />
&lt;div id=&#8221;gameSettings&#8221;&gt;<br />
&lt;br /&gt;<br />
Select Game Level :<br />
&lt;select id=&#8221;selectGameLevel&#8221;&gt;<br />
&lt;option value=&#8221;Easy&#8221;&gt;Easy&lt;/option&gt;<br />
&lt;option value=&#8221;Medium&#8221;&gt;Medium&lt;/option&gt;<br />
&lt;option value=&#8221;Hard&#8221;&gt;Hard&lt;/option&gt;<br />
&lt;/select&gt;<br />
&lt;/div&gt;<br />
&lt;div id=&#8221;parent&#8221; style=&#8221;float: left;&#8221;&gt;<br />
&lt;div class=&#8221;dragDiv&#8221;&gt;<br />
&lt;div id=&#8221;dragDivInner&#8221;&gt;<br />
&lt;div myid=&#8221;1&#8243; class=&#8221;droppable&#8221; myval=&#8221;I&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;2&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;3&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;6&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;7&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;8&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;9&#8243; class=&#8221;droppable&#8221; myval=&#8221;N&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;10&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;11&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;12&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;17&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;18&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;19&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;20&#8243; class=&#8221;Notdroppable&#8221; myval=&#8221;A&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;21&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;22&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;23&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;24&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;25&#8243; class=&#8221;Notdroppable&#8221; myval=&#8221;I&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;26&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;27&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;28&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;29&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;30&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;31&#8243; class=&#8221;Notdroppable&#8221; myval=&#8221;D&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;32&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;33&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;34&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;35&#8243; class=&#8221;droppable&#8221;&gt;&lt;/div&gt;<br />
&lt;div myid=&#8221;40&#8243; class=&#8221;Notdroppable&#8221;&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;div id=&#8221;countdiv&#8221; style=&#8221;display: none;&#8221;&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;div class=&#8221;dropDiv&#8221;&gt;<br />
&lt;div id=&#8221;draggedContent&#8221; style=&#8221;display: none;&#8221;&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;div id=&#8221;gamerules&#8221;&gt;<br />
&lt;ul&gt;<br />
&lt;li class=&#8221;caption&#8221;&gt;Find &#8220;INDIA&#8221; Game Rules &lt;/li&gt;<br />
&lt;li&gt;You can drag and drop any boxes. &lt;/li&gt;<br />
&lt;li&gt;We have set each letters from &#8220;INDIA&#8221; in the boxes. It is hidden&lt;/li&gt;<br />
&lt;li&gt;The game is, you need to find out the letters of &#8220;INDIA&#8221; by drag and drop the boxes to nearest box&lt;/li&gt;<br />
&lt;li&gt;Let us play the game now&#8230;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<h2><span id="conclusion">Conclusion</span></h2>
<p>Thanks a lot for reading. Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<h2><span id="your-turn-what-do-you-think">Your turn. What do you think?</span></h2>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/a-drag-and-drop-game/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Merge Multiple Arrays To One</title>
		<link>https://sibeeshpassion.com/merge-multiple-arrays-to-one/</link>
					<comments>https://sibeeshpassion.com/merge-multiple-arrays-to-one/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 18 Aug 2015 12:06:45 +0000</pubDate>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[jquery array]]></category>
		<category><![CDATA[jquery functions]]></category>
		<category><![CDATA[Merge Multiple Arrays To One]]></category>
		<category><![CDATA[Merge Multiple Arrays To One Without Using Loop]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=9791</guid>

					<description><![CDATA[In this post we will discuss how we can merge multiple arrays to one array using JQuery. There are so many ways to achieve this. Like we can loop through each array and push it to other array one by one or we can join those arrays one by one. Or we can use JQuery function merge() . But requirement was bit different. Since I was using large data, I was not able to use any loop or any long processes. We will discuss an easy way here in this article. I hope you will like this. Background Recently I [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will discuss how we can merge multiple arrays to one array using <a href="http://sibeeshpassion.com/tag/jquery/" target="_blank">JQuery</a>. There are so many ways to achieve this. Like we can loop through each array and push it to other array one by one or we can join those arrays one by one. Or we can use <a href="http://sibeeshpassion.com/tag/jquery-functions/" target="_blank">JQuery function</a> <em>merge() </em>. But requirement was bit different. Since  I was using large data, I was not able to use any loop or any long processes. We will discuss an easy way here in this article. I hope you will like this. </p>
<p><strong>Background</strong></p>
<p>Recently I got a requirement of merging large collections of client side arrays to one array. The problem was the arrays were dynamic, hence I was not sure about the count of those arrays, it may be different in different times. So what to do? A loop, merge, push, join in jquery was not a perfect solution for me since the data was large. So I found the solution in other way. </p>
<p><strong>Using the code</strong></p>
<p>Consider we have some arrays as follows.</p>
<p>[js]<br />
[21,2], [35,4], [25,6],[11,6],[44,67]<br />
[/js]</p>
<p>Now we need to change these arrays to a variable.</p>
<p>[js]<br />
var myArrays = [[21,2], [35,4], [25,6],[11,6],[44,67]];<br />
[/js]</p>
<p>Now here comes the real part.</p>
<p>[js]<br />
var myArray = [].concat.apply([], myArrays);<br />
[/js]</p>
<p>We are using <em>jquery concat</em> and <em>jquery apply()</em> function.</p>
<p>Now we will write this array to console.</p>
<p>[js]<br />
console.log(myArray);<br />
[/js]</p>
<p>See the console, you can get the values as follows.</p>
<div id="attachment_9801" style="width: 549px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/08/Merge_Multiple_Arrays_To_One.png"><img decoding="async" aria-describedby="caption-attachment-9801" src="http://sibeeshpassion.com/wp-content/uploads/2015/08/Merge_Multiple_Arrays_To_One.png" alt="Merge Multiple Arrays To One" width="539" height="270" class="size-full wp-image-9801" srcset="/wp-content/uploads/2015/08/Merge_Multiple_Arrays_To_One.png 539w, /wp-content/uploads/2015/08/Merge_Multiple_Arrays_To_One-300x150.png 300w, /wp-content/uploads/2015/08/Merge_Multiple_Arrays_To_One-400x200.png 400w" sizes="(max-width: 539px) 100vw, 539px" /></a><p id="caption-attachment-9801" class="wp-caption-text">Merge Multiple Arrays To One</p></div>
<p>You can see the demo at jsfiddle here: <a href="http://jsfiddle.net/sibeeshvenu/xyhc28jt/" target="_blank">Merge Multiple Arrays To One</a></p>
<p><strong>Conclusion</strong></p>
<p>I hope someone found it useful. Please share me your valuable suggestions and feedback. Thanks in advance.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/merge-multiple-arrays-to-one/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Find And Exclude Element From Array</title>
		<link>https://sibeeshpassion.com/find-and-exclude-element-from-array/</link>
					<comments>https://sibeeshpassion.com/find-and-exclude-element-from-array/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 05 Aug 2015 00:50:47 +0000</pubDate>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[exclude elements]]></category>
		<category><![CDATA[jquery array]]></category>
		<category><![CDATA[JQuery Click]]></category>
		<category><![CDATA[jquery functions]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=7772</guid>

					<description><![CDATA[In this post we well discuss about finding and excluding element from JQuery Array. We all worked in a JQuery. Sometimes we works in JQuery Arrays too. Right? Consider we have an array, and in that array we need to exclude a particular element and create a new array without excluded element. What we will do? We will use a for loop and just loop through the array,apply some conditions and if a criteria matches, we will do some operation right? Here I am going to share you an another way that we can achieve this by using a function [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we well discuss about finding and excluding element from JQuery Array. We all worked in a JQuery. Sometimes we works in JQuery Arrays too. Right? Consider we have an array, and in that array we need to exclude a particular element and create a new array without excluded element. What we will do? We will use a for loop and just loop through the array,apply some conditions and if a criteria matches, we will do some operation right? Here I am going to share you an another way that we can achieve this by using a function called <em>grep</em> in JQuery. Normally <em>grep</em> function act as <em>each</em> in JQuery. </p>
<p><strong>Backgroud</strong></p>
<p>I am working in a client side application where there are lots of client side arrays and variables. We handle our entire client side processes by using JQuery. I usually go through the operation of finding and removing array elements using JQuery. I thought it would be better if I share some knowledge about that here. I hope someone will find it is useful.</p>
<p><strong>Using the code</strong></p>
<p>To start with you need to include jquery reference.</p>
<p>[js]<br />
 &lt;script src=&quot;https://code.jquery.com/jquery-2.1.4.min.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Now we need an array right? Consider following is our array.</p>
<p>[js]<br />
var myArray = [&#8216;Monday&#8217;,&#8217;Tuesday&#8217;,&#8217;Wednesday&#8217;,&#8217;Thursday&#8217;,&#8217;Friday&#8217;,&#8217;Saturday&#8217;,&#8217;Sunday&#8217;]<br />
[/js]</p>
<p>Next, we will formulate this array to a HTML table, so that the visualization will be perfect. To do this we will have a function, which will just convert the array element to HTML table. Following is our function body.</p>
<p>[js]<br />
 function buildTable(array,message){<br />
	      var html='&lt;table&gt;&lt;caption&gt;&#8217;+message+'&lt;/caption&gt;&lt;tr&gt;&#8217;;<br />
		  for(var i=0;i&lt;array.length;i++)<br />
		  {<br />
			html+='&lt;td&gt;&#8217;+array[i]+'&lt;/td&gt;&#8217;;<br />
		  }<br />
		  html+='&lt;/tr&gt;&lt;/table&gt;&#8217;;<br />
		  $(&quot;#body&quot;).html(html);<br />
	   }<br />
[/js]	 </p>
<p>As you can see, the parameters for this functions are, an array and a caption message.<br />
Now we need to call this unction right?	 </p>
<p>[js]<br />
 var myArray = [&#8216;Monday&#8217;,&#8217;Tuesday&#8217;,&#8217;Wednesday&#8217;,&#8217;Thursday&#8217;,&#8217;Friday&#8217;,&#8217;Saturday&#8217;,&#8217;Sunday&#8217;]<br />
			var message=&quot;My Array Elements Before Removing&quot;;<br />
			buildTable(myArray,message);<br />
[/js]	 	</p>
<p>Style out HTML table by giving the preceding styles.	 </p>
<p>[css]<br />
 &lt;style&gt;<br />
		  tr{<br />
		     border:1px solid #ccc;<br />
		  }<br />
		  td{<br />
			 border:1px solid #ccc;<br />
			 padding: 10px;<br />
		  }<br />
		  #body{<br />
		    margin: 30px;<br />
		  }<br />
		  #click{<br />
		    margin: 30px;<br />
			cursor:pointer;<br />
		  }</p>
<p>      &lt;/style&gt;<br />
[/css]	 	 </p>
<p>So our output will be as follows. 	</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/07/Exclude_or_remove_array_element_from_array.png"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/07/Exclude_or_remove_array_element_from_array-300x48.png" alt="Exclude_or_remove_array_element_from_array" width="300" height="48" class="alignnone size-medium wp-image-7782" srcset="/wp-content/uploads/2015/07/Exclude_or_remove_array_element_from_array-300x48.png 300w, /wp-content/uploads/2015/07/Exclude_or_remove_array_element_from_array-400x64.png 400w, /wp-content/uploads/2015/07/Exclude_or_remove_array_element_from_array.png 597w" sizes="(max-width: 300px) 100vw, 300px" /></a>	</p>
<p>Now we need to fire a click event in which we will find out which element is to be excluded from the array, and finally assign new element set to our existing array. 	</p>
<p>[html]<br />
&lt;a hrefe=&quot;#&quot; id=&quot;click&quot;&gt;Click To Remove&lt;/a&gt;<br />
[/html]	 	 </p>
<p>[js]<br />
$(&quot;#click&quot;).click(function(){<br />
				var message=&quot;My Array Elements After Removing&quot;;<br />
				var excludedElement = [&#8216;Thursday&#8217;];<br />
				myArray = jQuery.grep(myArray, function(value) {<br />
				return value != excludedElement;<br />
			    });<br />
			    buildTable(myArray,message);<br />
			});<br />
[/js]	 </p>
<p>Here we are finding the element <em>&#8216;Thursday&#8217;</em> which we saved to a variable as follows.</p>
<p>[js]<br />
var excludedElement = [&#8216;Thursday&#8217;];<br />
[/js]	 	</p>
<p>Now our real here is <em>jQuery.grep</em> , which returns our new array with filtered data.</p>
<p>[js]<br />
return value != excludedElement;<br />
[/js]	 </p>
<p>And then we are calling our <em>buildTable</em> function to formulate our new array to a HTML table. Once we call it we will get an output as follows.	 	</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2015/07/Exclude_or_remove_array_element_from_array_after.png"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2015/07/Exclude_or_remove_array_element_from_array_after-300x60.png" alt="Exclude_or_remove_array_element_from_array_after" width="300" height="60" class="alignnone size-medium wp-image-7792" srcset="/wp-content/uploads/2015/07/Exclude_or_remove_array_element_from_array_after-300x60.png 300w, /wp-content/uploads/2015/07/Exclude_or_remove_array_element_from_array_after-400x81.png 400w, /wp-content/uploads/2015/07/Exclude_or_remove_array_element_from_array_after.png 501w" sizes="(max-width: 300px) 100vw, 300px" /></a>	 </p>
<p><strong>Complete Code</strong>	 	</p>
<p>[html]<br />
&lt;html&gt;<br />
   &lt;head&gt;<br />
      &lt;title&gt;Remove Elements From An Array using JQuery- Sibeesh Passion&lt;/title&gt;<br />
      &lt;style&gt;<br />
		  tr{<br />
		     border:1px solid #ccc;<br />
		  }<br />
		  td{<br />
			 border:1px solid #ccc;<br />
			 padding: 10px;<br />
		  }<br />
		  #body{<br />
		    margin: 30px;<br />
		  }<br />
		  #click{<br />
		    margin: 30px;<br />
			cursor:pointer;<br />
		  }</p>
<p>      &lt;/style&gt;<br />
      &lt;script src=&quot;https://code.jquery.com/jquery-2.1.4.min.js&quot;&gt;&lt;/script&gt;<br />
   &lt;/head&gt;<br />
   &lt;body&gt;<br />
   &lt;a hrefe=&quot;#&quot; id=&quot;click&quot;&gt;Click To Remove&lt;/a&gt;<br />
   &lt;div id=&quot;body&quot;&gt;&lt;/div&gt;<br />
      &lt;script&gt;<br />
       $(document).ready(function(){<br />
		    var myArray = [&#8216;Monday&#8217;,&#8217;Tuesday&#8217;,&#8217;Wednesday&#8217;,&#8217;Thursday&#8217;,&#8217;Friday&#8217;,&#8217;Saturday&#8217;,&#8217;Sunday&#8217;]<br />
			var message=&quot;My Array Elements Before Removing&quot;;<br />
			buildTable(myArray,message);</p>
<p>			$(&quot;#click&quot;).click(function(){<br />
				var message=&quot;My Array Elements After Removing&quot;;<br />
				var excludedElement = [&#8216;Thursday&#8217;];<br />
				myArray = jQuery.grep(myArray, function(value) {<br />
				return value != excludedElement;<br />
			    });<br />
			    buildTable(myArray,message);<br />
			});<br />
	   });<br />
	   function buildTable(array,message){<br />
	      var html='&lt;table&gt;&lt;caption&gt;&#8217;+message+'&lt;/caption&gt;&lt;tr&gt;&#8217;;<br />
		  for(var i=0;i&lt;array.length;i++)<br />
		  {<br />
			html+='&lt;td&gt;&#8217;+array[i]+'&lt;/td&gt;&#8217;;<br />
		  }<br />
		  html+='&lt;/tr&gt;&lt;/table&gt;&#8217;;<br />
		  $(&quot;#body&quot;).html(html);<br />
	   }<br />
      &lt;/script&gt;</p>
<p>   &lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]	 </p>
<p><strong>Demo</strong></p>
<p>Please find out the demo in jsfiddle here: <a href="http://jsfiddle.net/sibeeshvenu/099odrbq/" target="_blank">Exclude or remove elements</a></p>
<p><strong>Conclusion</strong>	</p>
<p>I hope you liked this article. Please share me your feedback. It is always welcomed. Thanks in advance.	 </p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/find-and-exclude-element-from-array/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Remove First Character From A String</title>
		<link>https://sibeeshpassion.com/remove-first-character-from-a-string/</link>
					<comments>https://sibeeshpassion.com/remove-first-character-from-a-string/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 22 Jul 2015 12:20:08 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[jquery functions]]></category>
		<category><![CDATA[Remove First Character]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=7751</guid>

					<description><![CDATA[In this post, we will see how we can remove first character from a string in JQuery. I hope you will like it. Consider I have a string like below. [js] var myString= &#34;&#38;2014&#34;; [/js] Now I need to remove &#038; from my string and the output must be &#8220;2014&#8221;. So we can do as follows. [js] var myString= &#34;&#38;2014&#34;; myString=myString.substring(1); [/js] Now myString contains the value of &#8220;2014&#8221;. Please see other code snippets here: http://sibeeshpassion.com/category/code-snippets/ Kindest Regards Sibeesh Venu]]></description>
										<content:encoded><![CDATA[<p>In this post, we will see how we can remove first character from a string in JQuery. I hope you will like it.</p>
<p>Consider I have a string like below.</p>
<p>[js]<br />
var myString= &quot;&amp;2014&quot;;<br />
[/js]</p>
<p>Now I need to remove &#038; from my string and the output must be &#8220;2014&#8221;.</p>
<p>So we can do as follows.</p>
<p>[js]<br />
var myString= &quot;&amp;2014&quot;;<br />
myString=myString.substring(1);<br />
[/js]</p>
<p>Now myString contains the value of &#8220;2014&#8221;.</p>
<p>Please see other code snippets here: <a href="http://sibeeshpassion.com/category/code-snippets/" target="_blank">http://sibeeshpassion.com/category/code-snippets/</a></p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/remove-first-character-from-a-string/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Remove a DOM element using JQuery</title>
		<link>https://sibeeshpassion.com/remove-a-dom-element-using-jquery/</link>
					<comments>https://sibeeshpassion.com/remove-a-dom-element-using-jquery/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 01 Jul 2015 10:22:00 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[.remove()]]></category>
		<category><![CDATA[delete UI]]></category>
		<category><![CDATA[jquery events]]></category>
		<category><![CDATA[jquery functions]]></category>
		<category><![CDATA[remove DOM]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=5981</guid>

					<description><![CDATA[Introduction Hi All, How are you today? In this article we will see how we can remove a DOM element using JQuery. I hope you will like it. Background I know we all are working in the client side technologies, especially in JQuery. Sometimes we may need to write more client side codes rather than server side codes. In that case, you may need to remove some DOM elements pragmatically. Here I am going to give you a demo of how we can do this requirement. Using the code To start with, as you all know we need to load [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>Hi All, How are you today? In this article we will see how we can remove a DOM element using JQuery. I hope you will like it.</p>
<p><strong>Background</strong></p>
<p>I know we all are working in the client side technologies, especially in JQuery. Sometimes we may need to write more client side codes rather than server side codes. In that case, you may need to remove some DOM elements pragmatically. Here I am going to give you a demo of how we can do this requirement.</p>
<p><strong>Using the code</strong></p>
<p>To start with, as you all know we need to load the JQuery reference.</p>
<p>[js]<br />
&lt;script src=&quot;https://code.jquery.com/jquery-2.1.4.min.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Once you load the reference you are ready to go.</p>
<p>Since this is a demo, we will explain with some steps. Sounds good?. So we will do the following tasks.</p>
<li>Add the elements to the DOM</li>
<li>Delete the DOM elements using <em>.remove()</em>, <em>.get()</em> functions</li>
<p>Shall we start then?</p>
<p><strong>Add the elements to the DOM</strong></p>
<p>We need to set our UI first right?</p>
<p>[html]<br />
&lt;body id=&quot;body&quot;&gt;<br />
    Remove a DOM element from the UI using JQuery- Sibeesh Passion<br />
    &lt;br/&gt;<br />
    &lt;br/&gt;<br />
    &lt;p id=&quot;addMe&quot;&gt;Generate 10 Elements&lt;/p&gt;<br />
&lt;/body&gt;<br />
[/html]</p>
<p><strong>Add CSS</strong><br />
[css]<br />
&lt;style&gt;<br />
        p {<br />
            color: red;<br />
            width: 170px;<br />
            cursor: pointer;<br />
            border: 1px solid #ccc;<br />
            text-align: center;<br />
        }<br />
        #deleteMe {<br />
            color: white;<br />
            width: 170px;<br />
            cursor: pointer;<br />
            border: 1px solid #ccc;<br />
            text-align: center;<br />
            background-color: blue;<br />
        }<br />
    &lt;/style&gt;<br />
[/css]</p>
<p>So we have set our UI, and now if you run your page you can see output as follows.</p>
<p><img decoding="async" src="http://www.sibeeshpassion.com/content/images/rmdm1.png" alt="www.sibeeshpassion.com" /></p>
<p>Now we will add the needful scripts.</p>
<p>[js]<br />
 &lt;script&gt;<br />
        $(document).ready(function() {<br />
            $(&quot;#addMe&quot;).click(function() {<br />
                var html = &#8216;&lt;table&gt;&#8217;;<br />
                for (var i = 1; i &lt;= 10; i++) {<br />
                    html += &quot;&lt;tr&gt;&lt;p&gt;My Elements&lt;/p&gt;&lt;/tr&gt;&quot;;<br />
                }<br />
                html += &#8216;&lt;/table&gt;&#8217;;<br />
                $(&#8216;#body&#8217;).append(html).append(&#8216;&lt;div id=&quot;deleteMe&quot;&gt;Delete 5 Elements&lt;/div&gt;&#8217;);<br />
                $(&quot;#addMe&quot;).hide();<br />
            });<br />
            $(document).on(&#8216;click&#8217;, &#8216;#deleteMe&#8217;, function() {<br />
                for (var i = 1; i &lt;= 5; i++) {<br />
                    $(&#8216;#body&#8217;).find(&#8216;p&#8217;).get(i).remove();<br />
                }<br />
                $(&quot;#addMe&quot;).hide();<br />
                $(&quot;#deleteMe&quot;).hide();<br />
            });</p>
<p>        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>As you can see we are adding elements to the DOM with a loop. Once you run the page you can see the output as follows.</p>
<p><img decoding="async" src="http://www.sibeeshpassion.com/content/images/rmdm2.png" alt="www.sibeeshpassion.com" /></p>
<p>And once you click on &#8220;Delete 5 Elements&#8221; button, 5 DOM elements will be deleted.</p>
<p><img decoding="async" src="http://www.sibeeshpassion.com/content/images/rmdm3.png" alt="www.sibeeshpassion.com" /></p>
<p>The following code block describes how we can use <em>.remove()</em> function.</p>
<p>[js]<br />
 $(&#8216;#body&#8217;).find(&#8216;p&#8217;).get(i).remove();<br />
[/js]</p>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;html&gt;</p>
<p>&lt;head&gt;<br />
    &lt;title&gt;emove a DOM element from the UI usign JQuery- Sibeesh Passion&lt;/title&gt;<br />
    &lt;style&gt;<br />
        p {<br />
            color: red;<br />
            width: 170px;<br />
            cursor: pointer;<br />
            border: 1px solid #ccc;<br />
            text-align: center;<br />
        }<br />
        #deleteMe {<br />
            color: white;<br />
            width: 170px;<br />
            cursor: pointer;<br />
            border: 1px solid #ccc;<br />
            text-align: center;<br />
            background-color: blue;<br />
        }<br />
    &lt;/style&gt;<br />
    &lt;script src=&quot;https://code.jquery.com/jquery-2.1.4.min.js&quot;&gt;&lt;/script&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body id=&quot;body&quot;&gt;<br />
    Remove a DOM element from the UI using JQuery- Sibeesh Passion<br />
    &lt;br/&gt;<br />
    &lt;br/&gt;<br />
    &lt;p id=&quot;addMe&quot;&gt;Generate 10 Elements&lt;/p&gt;<br />
    &lt;script&gt;<br />
        $(document).ready(function() {<br />
            $(&quot;#addMe&quot;).click(function() {<br />
                var html = &#8216;&lt;table&gt;&#8217;;<br />
                for (var i = 1; i &lt;= 10; i++) {<br />
                    html += &quot;&lt;tr&gt;&lt;p&gt;My Elements&lt;/p&gt;&lt;/tr&gt;&quot;;<br />
                }<br />
                html += &#8216;&lt;/table&gt;&#8217;;<br />
                $(&#8216;#body&#8217;).append(html).append(&#8216;&lt;div id=&quot;deleteMe&quot;&gt;Delete 5 Elements&lt;/div&gt;&#8217;);<br />
                $(&quot;#addMe&quot;).hide();<br />
            });<br />
            $(document).on(&#8216;click&#8217;, &#8216;#deleteMe&#8217;, function() {<br />
                for (var i = 1; i &lt;= 5; i++) {<br />
                    $(&#8216;#body&#8217;).find(&#8216;p&#8217;).get(i).remove();<br />
                }<br />
                $(&quot;#addMe&quot;).hide();<br />
                $(&quot;#deleteMe&quot;).hide();<br />
            });</p>
<p>        });<br />
    &lt;/script&gt;<br />
&lt;/body&gt;</p>
<p>&lt;/html&gt;<br />
[/html]</p>
<p><strong>Conclusion</strong></p>
<p>I hope you will like this article. Please share me your valuable thoughts and comments. Your feedback is always welcomed.</p>
<p>Thanks in advance. Happy coding!</p>
<p>Kindest Regards<br />
<a href="https://plus.google.com/+sibeeshkv" target="_blank">Sibeesh Venu</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/remove-a-dom-element-using-jquery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Check whether an array contains a particular element</title>
		<link>https://sibeeshpassion.com/check-whether-an-array-contains-a-particular-element/</link>
					<comments>https://sibeeshpassion.com/check-whether-an-array-contains-a-particular-element/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 30 Jun 2015 06:23:21 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[check array]]></category>
		<category><![CDATA[check element in array]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery functions]]></category>
		<category><![CDATA[jquery inarray]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=5531</guid>

					<description><![CDATA[Introduction Hi All, How are you today? In this article we will see how we can check whether an array element is present in an array. We will be using JQuery to do this requirement. I hope you will like it. Background I know we all are working in the client side technologies, especially in JQuery. Sometimes we may need to write more client side codes rather than server side codes. In that case, you will be using client side arrays too. So if you use client side arrays,sometimes you may need to check the array contains a particular element [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>Hi All, How are you today? In this article we will see how we can check whether an array element is present in an array. We will be using JQuery to do this requirement. I hope you will like it.</p>
<p><strong>Background</strong></p>
<p>I know we all are working in the client side technologies, especially in JQuery. Sometimes we may need to write more client side codes rather than server side codes. In that case, you will be using client side arrays too. So if you use client side arrays,sometimes you may need to check the array contains a particular element or not.Then only you can do some codes according to that. Here I am going to give you a demo of how we can do this requirement.</p>
<p><strong>Using the code</strong></p>
<p>To start with, as you all know we need to load the JQuery reference.</p>
<p>[js]<br />
&lt;script src=&quot;https://code.jquery.com/jquery-2.1.4.min.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<p>Once you load the reference you are ready to go.</p>
<p>Since this is a demo, we will explain with some steps. Sounds good?. So we will do the following tasks.</p>
<li>Add the elements to the array</li>
<li>Check the elements are added or not</li>
<li>Search an element</li>
<p>Shall we start then?</p>
<p><strong>Add the elements to the array</strong></p>
<p>We need to set our UI first right?</p>
<p>[html]<br />
&lt;body&gt;<br />
    Check whether an array contains a particular element &#8211; Sibeesh Passion<br />
    &lt;br/&gt;<br />
    &lt;br/&gt;<br />
    &lt;table&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;<br />
                &lt;input type=&quot;text&quot; id=&quot;myText&quot; /&gt;<br />
            &lt;/td&gt;<br />
            &lt;td&gt;<br />
                &lt;p id=&quot;addMe&quot;&gt;Add Me&lt;/p&gt;<br />
            &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;<br />
                &lt;p id=&quot;showMe&quot;&gt;Show Array Length&lt;/p&gt;<br />
            &lt;/td&gt;<br />
            &lt;td id=&quot;showContent&quot;&gt;Array length is<br />
            &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;<br />
                &lt;input type=&quot;text&quot; id=&quot;searchText&quot; /&gt;<br />
            &lt;/td&gt;<br />
            &lt;td&gt;<br />
                &lt;p id=&quot;searchMe&quot;&gt;Search Me&lt;/p&gt;<br />
            &lt;/td&gt;<br />
            &lt;td id=&quot;searchOutput&quot;&gt;The given text &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
    &lt;/table&gt;<br />
&lt;/body&gt;<br />
[/html]</p>
<p>So we have set our UI, and now if you run your page you can see output as follows.</p>
<p><img decoding="async" src="http://www.sibeeshpassion.com/content/images/chkelm1.png" alt="www.sibeeshpassion.com" /></p>
<p>Now we will add the needful scripts.</p>
<p>[js]<br />
&lt;script&gt;<br />
        $(document).ready(function() {<br />
            var myArray = [];<br />
            var i = 0;<br />
            $(&quot;#addMe&quot;).click(function() {<br />
                myArray[i] = $(&quot;#myText&quot;).val();<br />
                $(&quot;#myText&quot;).val(&#8221;);<br />
                i++;<br />
            });<br />
            $(&quot;#showMe&quot;).click(function() {<br />
                $(&quot;#showContent&quot;).text(&quot;Array length is &quot; + myArray.length);<br />
            });<br />
            $(&quot;#searchMe&quot;).click(function() {<br />
                if (jQuery.inArray($(&quot;#searchText&quot;).val(), myArray) &gt; -1)<br />
                    $(&quot;#searchOutput&quot;).text(&quot;The given text &quot; + $(&quot;#searchText&quot;).val() + &quot; is available in the array&quot;);<br />
                else<br />
                    $(&quot;#searchOutput&quot;).text(&quot;The given text &quot; + $(&quot;#searchText&quot;).val() + &quot; is  not available in the array&quot;);</p>
<p>            });<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>As you can see we are adding elements to the array, checking the array element in the first two click functions. But what about the third click function. Bingo! there we are using <em>jQuery.inArray</em> function to check our element is present in the array or not.</p>
<p>No we will learn little about the <em>jQuery.inArray</em> function.</p>
<p><strong>jQuery.inArray</strong></p>
<li>It is used for searching a specified value within an array</li>
<li>It returns -1 if it does not contain the searched value</li>
<li>It returns index of the searched value if it contains the value</li>
<p>The following code block describes how we can use <em>jQuery.inArray</em></p>
<p>[js]<br />
if (jQuery.inArray($(&quot;#searchText&quot;).val(), myArray) &gt; -1)<br />
                    $(&quot;#searchOutput&quot;).text(&quot;The given text &quot; + $(&quot;#searchText&quot;).val() + &quot; is available in the array&quot;);<br />
                else<br />
                    $(&quot;#searchOutput&quot;).text(&quot;The given text &quot; + $(&quot;#searchText&quot;).val() + &quot; is  not available in the array&quot;);</p>
<p>[/js]</p>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;html&gt;</p>
<p>&lt;head&gt;<br />
    &lt;title&gt;Check whether an array contains a particular element &#8211; Sibeesh Passion&lt;/title&gt;<br />
    &lt;style&gt;<br />
        p {<br />
            color: red;<br />
            width: 170px;<br />
            cursor: pointer;<br />
            border: 1px solid #ccc;<br />
            text-align: center;<br />
        }<br />
    &lt;/style&gt;<br />
    &lt;script src=&quot;https://code.jquery.com/jquery-2.1.4.min.js&quot;&gt;&lt;/script&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
    Check whether an array contains a particular element &#8211; Sibeesh Passion<br />
    &lt;br/&gt;<br />
    &lt;br/&gt;<br />
    &lt;table&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;<br />
                &lt;input type=&quot;text&quot; id=&quot;myText&quot; /&gt;<br />
            &lt;/td&gt;<br />
            &lt;td&gt;<br />
                &lt;p id=&quot;addMe&quot;&gt;Add Me&lt;/p&gt;<br />
            &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;<br />
                &lt;p id=&quot;showMe&quot;&gt;Show Array Length&lt;/p&gt;<br />
            &lt;/td&gt;<br />
            &lt;td id=&quot;showContent&quot;&gt;Array length is<br />
            &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;&lt;/tr&gt;<br />
        &lt;tr&gt;<br />
            &lt;td&gt;<br />
                &lt;input type=&quot;text&quot; id=&quot;searchText&quot; /&gt;<br />
            &lt;/td&gt;<br />
            &lt;td&gt;<br />
                &lt;p id=&quot;searchMe&quot;&gt;Search Me&lt;/p&gt;<br />
            &lt;/td&gt;<br />
            &lt;td id=&quot;searchOutput&quot;&gt;The given text &lt;/td&gt;<br />
        &lt;/tr&gt;<br />
    &lt;/table&gt;<br />
    &lt;script&gt;<br />
        $(document).ready(function() {<br />
            var myArray = [];<br />
            var i = 0;<br />
            $(&quot;#addMe&quot;).click(function() {<br />
                myArray[i] = $(&quot;#myText&quot;).val();<br />
                $(&quot;#myText&quot;).val(&#8221;);<br />
                i++;<br />
            });<br />
            $(&quot;#showMe&quot;).click(function() {<br />
                $(&quot;#showContent&quot;).text(&quot;Array length is &quot; + myArray.length);<br />
            });<br />
            $(&quot;#searchMe&quot;).click(function() {<br />
                if (jQuery.inArray($(&quot;#searchText&quot;).val(), myArray) &gt; -1)<br />
                    $(&quot;#searchOutput&quot;).text(&quot;The given text &quot; + $(&quot;#searchText&quot;).val() + &quot; is available in the array&quot;);<br />
                else<br />
                    $(&quot;#searchOutput&quot;).text(&quot;The given text &quot; + $(&quot;#searchText&quot;).val() + &quot; is  not available in the array&quot;);</p>
<p>            });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/body&gt;</p>
<p>&lt;/html&gt;<br />
[/html]</p>
<p>Now we will run our page and see the output.</p>
<p><strong>Output</strong></p>
<p><img decoding="async" src="http://www.sibeeshpassion.com/content/images/chkelm2.png" alt="www.sibeeshpassion.com" /></p>
<p><img decoding="async" src="http://www.sibeeshpassion.com/content/images/chkelm3.png" alt="www.sibeeshpassion.com" /></p>
<p><img decoding="async" src="http://www.sibeeshpassion.com/content/images/chkelm4.png" alt="www.sibeeshpassion.com" /></p>
<p><img decoding="async" src="http://www.sibeeshpassion.com/content/images/chkelmgif.gif" alt="www.sibeeshpassion.com" /></p>
<p>That is all.</p>
<p><strong>Conclusion</strong></p>
<p>I hope you will like this article. Please share me your valuable thoughts and comments. Your feedback is always welcomed.</p>
<p>Thanks in advance. Happy coding!</p>
<p>Kindest Regards<br />
<a href="https://plus.google.com/+sibeeshkv" target="_blank">Sibeesh Venu</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/check-whether-an-array-contains-a-particular-element/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
