Skip to main content

Bug Tracker

Side navigation

#9761 closed enhancement (duplicate)

Opened July 06, 2011 07:20PM UTC

Closed July 06, 2011 11:47PM UTC

Last modified July 06, 2011 11:47PM UTC

$('title') is inconsistent

Reported by: anonymous Owned by:
Priority: low Milestone: 1.next
Component: manipulation Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:
Description

The selector $('title') returns a DOMElement in all major browsers (currently tested : IE, FF, Chrome). However, only in Chrome and FF does $('title').text("New title"); or $('title').html("New title"); works. In IE, setting new content to the <title> element (ie. $('title')[0].innerHTML = "New title";) does not work.

The only way to set this is with : document.title = "New title";

This is inconsistent, it should be documented or fixed.

Attachments (0)
Change History (3)

Changed July 06, 2011 09:02PM UTC by timmywil comment:1

component: unfiledmanipulation
priority: undecidedlow

Thanks for taking the time to contribute to the jQuery project!

This is such an edge case I'm not sure we should put it in the docs or change the default browser behaviors.

Changed July 06, 2011 11:47PM UTC by dmethvin comment:2

resolution: → duplicate
status: newclosed

There is no need to use jQuery at all when document.title will do the job quickly on all browsers.

Changed July 06, 2011 11:47PM UTC by dmethvin comment:3

Duplicate of #2755.