Hi there,
The <title> tag acts a little differently from other DOM nodes. You
can just edit the DOM property document.title directly.
$(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
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---