Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#9761 closed enhancement (duplicate)

$('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.

Change History (3)

comment:1 Changed 8 years ago by timmywil

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.

comment:2 Changed 8 years ago by dmethvin

Resolution: duplicate
Status: newclosed

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

comment:3 Changed 8 years ago by dmethvin

Duplicate of #2755.

Note: See TracTickets for help on using tickets.