Grab the title value by using parent()
<p>I have this html code:</p>

<pre><code>&lt;a class="ms-navedit-linkNode" title="Apps" href="url/test"&gt;
    &lt;span class="menu-item-text"&gt;Apps&lt;/span&gt;
&lt;/a&gt;
</code></pre>

<p>I want to change the title value from "Apps" to something else.</p>

<p>Here is the javascript that Im using but it just gives my title variable <code>undefined</code>.</p>

<p>Note: Everything else works great in my js code</p>

<pre><code>&lt;script type="text/javascript"&gt;
    $(document).ready(function() {
        $(".menu-item-text").each(function() {
            var text = $(this).text();
            if (text == "Apps") {
                $(this).text("");
                $(this).text("Organization");

                var title = $(this).parent().attr("title");

                if (title == "Apps") {
                    $(this).parent().attr("title", "Organization");
                }
            }
        });
    });
&lt;/script&gt;
</code></pre>

<p>Am I doing something wrong here?</p>
