So I am making a website and everything is nicely done but I don't know that many things with javascript.
I was searching for something that will help me with this and found some similar things but it doesn't work in my case.
This is the problem/idea:
So if someone can help me with the code and explain it a little bit.
Thank you.
The page title is defined in the HTML header and is shown as the tab name in a browser. Whatever is defined in the <title></title> tag is shown as the tab name in the browser window and as the title of the page in the search engine results pages. The page title is shown in the Google Search Results.
Quick rename can be done by right-clicking anywhere in the page and click on "Rename Tab". Changelog: https://github.com/sylouuu/chrome-tab-modifier/releases About Permissions: All websites are required as the extension needs to update each visited website to do its job.
You need to make use of the onblur and onfocus events for the window object.
So something like this (this is native javascript, no jquery).
<script>
window.onblur = function () { document.title = 'you went?'; }
window.onfocus = function () { document.title = 'you came back'; }
</script>
$(window).focus(function() {
document.title = 'defult title';
});
$(window).blur(function() {
document.title = 'you went?';
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With