How do I show a JS variable on the TITLE tag?

Carlos Carlsen
<!DOCTYPE html>
<html>
<head>
</head>
<body>
  <p id="timer"></p>
  <script>
  var a = 30;
  var b = 1;

  var c = document.getElementById('timer').innerHTML = a - b;
 </script>
</body>
</html>

Thanks for taking your time to look at this!

How would I show VARIABLE C inside the HTML TITLE tag??

so:

<title>SHOW WHAT VARIABLE c IS EQUAL TO</title>

The point for this is to make a countdown timer that will show your time in your tab so you don't have to keep checking. Also, right now it just subtracts 1, how would I make it KEEP subtracting??

THANK YOU!!

I appreciate it

Oleksandr T.

You can use document.title, like so

  var a = 30;
  var b = 1;

  var c = document.getElementById('timer').innerHTML = a - b;
  document.title = c;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I show GitBook title?

How do i show toast and title in new changed language in android

How do I not show the colum title in a simple table?

How Do I Change an <svg> Tag To An <img> Tag with js?

Js How do I add up all numbers into one variable and show it?

How do I make selenium wait for a specific tag show up

How do I show the error string between typography tag

How do I show and hide input when anchor tag is clicked?

How do I set a JavaScript variable to the contents of a textarea tag?

How do I find a child by tag name of a variable element?

How can i assign the name of an anchor tag to a variable in JS?

How do I include the wordpress title in the URL while echo in conditional tag?

How do I stop KeePass from automatch-ing all pages, when using the tag/title "Google"

How do I make text inside the title tag animate using JavaScript?

How do I show variable values with zero entries in PROC SQL?

Array, How i show both title and Description?

Not able to bind Js variable into table column title tag

How do I read JS as data from a script tag?

How do I hide the select tag based on Js iteration of a list

How do I show Border Frame and Title Bar on MainWindow on Cross Compiled Application on an RPi3?

How do I make the Settings bar always show me the settings instead of the title

How do I show a 'loading' animation while using .load in JS?

Vuetify and require.js: How do I show a dynamic component?

How do I show my website on a Node.js server?

Chrome Extension: How do I get current tabs title and assign string to variable?

how to show hidden i tag on mouse click

How can I hide or show input tag?

How do I show a HTML tag only when Express view engine passes a value?

How do I scrape this tag?