[jquery-dev] Re: Traversing the element and accessing the content.</span></a></span> </h1> <p class="darkgray font13"> <span class="sender pipe"><a href="/search?l=jquery-dev@googlegroups.com&q=from:%22Karl+Swedberg%22" rel="nofollow"><span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Karl Swedberg</span></span></a></span> <span class="date"><a href="/search?l=jquery-dev@googlegroups.com&q=date:20090911" rel="nofollow">Fri, 11 Sep 2009 09:09:15 -0700</a></span> </p> </div> <div itemprop="articleBody" class="msgBody"> <!--X-Body-of-Message--> <pre>Hi there, The <title> tag acts a little differently from other DOM nodes. You can just edit the DOM property document.title directly.</pre><pre> $(document).ready(function() { var titleText = document.title; $('#test').val(titleText); }); --Karl ____________ Karl Swedberg www.englishrules.com www.learningjquery.com On Sep 11, 2009, at 7:01 AM, Ezence wrote: > > Hi, > > There seems to be a problem with using $('title').text() in IE7 and > IE8 - wondering if this is a known problem and if there are any work > arounds. > > sample code: > > <html> > <head> > <title>Example</title> > <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> > > <script type="text/javascript"> > $(document).ready(function(){ > > $('#test').val($('title').text()); > > }); > </script> > > </head> > <body> > <input type="text" id="test" /> > </body> > </html> > > It works fine within Chrome and Firefox. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at <a rel="nofollow" href="http://groups.google.com/group/jquery-dev?hl=en">http://groups.google.com/group/jquery-dev?hl=en</a> -~----------~----~----~----~------~----~------~--~--- </pre> </div> <div class="msgButtons margintopdouble"> <ul class="overflow"> <li class="msgButtonItems"><a class="button buttonleft " accesskey="p" href="msg05612.html">Previous message</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="c" href="thrd3.html#05613">View by thread</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="i" href="mail3.html#05613">View by date</a></li> <li class="msgButtonItems textalignright"><a class="button buttonright " accesskey="n" href="msg06082.html">Next message</a></li> </ul> </div> <a name="tslice"></a> <div class="tSliceList margintopdouble"> <ul class="icons monospace"> <li class="icons-email"><span class="subject"><a href="msg05612.html">[jquery-dev] Traversing the <title> element and access...</a></span> <span class="sender italic">Ezence</span></li> <li><ul> <li class="icons-email tSliceCur"><span class="subject">[jquery-dev] Re: Traversing the <title> element a...</span> <span class="sender italic">Karl Swedberg</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg06082.html">[jquery-dev] Re: Traversing the <title> eleme...</a></span> <span class="sender italic">Van</span></li> </ul> </ul> </ul> </div> <div class="overflow msgActions margintopdouble"> <div class="msgReply" > <h2> Reply via email to </h2> <form method="POST" action="/mailto.php"> <input type="hidden" name="subject" value="[jquery-dev] Re: Traversing the <title> element and accessing the content."> <input type="hidden" name="msgid" value="DE1C4A5E-F2B6-4C8F-B045-030B670C219C@englishrules.com"> <input type="hidden" name="relpath" value="jquery-dev@googlegroups.com/msg05613.html"> <input type="submit" value=" Karl Swedberg "> </form> </div> </div> </div> <div class="aside" role="complementary"> <div class="logo"> <a href="/"><img src="/logo.png" width=247 height=88 alt="The Mail Archive"></a> </div> <form class="overflow" action="/search" method="get"> <input type="hidden" name="l" value="jquery-dev@googlegroups.com"> <label class="hidden" for="q">Search the site</label> <input class="submittext" type="text" id="q" name="q" placeholder="Search jquery-dev"> <input class="submitbutton" name="submit" type="image" src="/submit.png" alt="Submit"> </form> <div class="nav margintop" id="nav" role="navigation"> <ul class="icons font16"> <li class="icons-home"><a href="/">The Mail Archive home</a></li> <li class="icons-list"><a href="/jquery-dev@googlegroups.com/">jquery-dev - all messages</a></li> <li class="icons-about"><a href="/jquery-dev@googlegroups.com/info.html">jquery-dev - about the list</a></li> <li class="icons-expand"><a href="/search?l=jquery-dev@googlegroups.com&q=subject:%22%5C%5Bjquery%5C-dev%5C%5D+Re%5C%3A+Traversing+the+%3Ctitle%3E+element+and+accessing+the+content.%22&o=newest&f=1" title="e" id="e">Expand</a></li> <li class="icons-prev"><a href="msg05612.html" title="p">Previous message</a></li> <li class="icons-next"><a href="msg06082.html" title="n">Next message</a></li> </ul> </div> <div class="listlogo margintopdouble"> </div> <div class="margintopdouble"> </div> </div> </div> <div class="footer" role="contentinfo"> <ul> <li><a href="/">The Mail Archive home</a></li> <li><a href="/faq.html#newlist">Add your mailing list</a></li> <li><a href="/faq.html">FAQ</a></li> <li><a href="/faq.html#support">Support</a></li> <li><a href="/faq.html#privacy">Privacy</a></li> <li class="darkgray">DE1C4A5E-F2B6-4C8F-B045-030B670C219C@englishrules.com</li> </ul> </div> </body> </html>