在3秒钟的延迟后如何使用javascript更改窗口标题?

延迟3秒后,我需要更改窗口标题栏

像这样使用javascript www.nazeer.com

评论
苍涼
苍涼
setTimeout( (() => { window.document.title = 'Your title'}),3000)

You can use setTimeout for delay, and window.document.title to change title/ Hope i help :)

点赞
评论
格式化
格式化

You can change the title using document.title = "value"

You can delay 3 seconds(3 * 1000 milliseconds) and then change using setTimeout function.

setTimeout(function(){
    document.title = "NEW TITLE"
}, 3000);

在这里,3000是时间(以毫秒为单位)。

Refer this more queries - How to dynamically change a web page's title?

点赞
评论
忧郁逗比
忧郁逗比

下面的示例给出了Try This

setTimeout(()=>{
window.document.title = "Your OWn";
console.log("changing Title");

},3000);
点赞
评论