Javascript array object in jquery
<p>I have following code snippet in jquery.In which,I want to animate each element of array one by one.</p>

<pre><code>&lt;script type="text/javascript"&gt;
        function AnimateText() {
            var myCars = new Array("Saab", "Volvo", "BMW");
            myCars.each(function () {
                $(this).fadeIn("2000").fadeOut("2000");
            });

        }

    &lt;/script&gt;
</code></pre>

<p>But I am getting this error <strong>Object does not support this method or property</strong></p>

<p><strong>EDIT</strong></p>

<p>Thanks all for the answer.Now I have problem in animating the array element on the screen.</p>

<hr>

<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default7.aspx.cs" Inherits="Default7" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;script src="Scripts/jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
        function AnimateText() {
            var myCars = new Array("Saab", "Volvo", "BMW");
            $.each(myCars, function (key, value) {
                $("#myDiv").html(value).fadeIn("2000") ;
            });

        }

    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div id="myDiv"&gt;&lt;/div&gt;
    &lt;input type="button" id="btnTest" value="Animate" onclick="AnimateText();" /&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
