0

complete coding & JS noob here, so I appreciate this may seem like a very stupid question:

I have some very basic JS (below) that I would like to run based on the of the browser tab that it is running in. How do I make this run if the browser title is "xyz"?

var x = "thing";
console.log(x);
Henry
  • 36
  • 7
  • 1
    `document.title` will be the string you want to check against: https://developer.mozilla.org/en-US/docs/Web/API/Document/title – Terry Sep 24 '22 at 06:29

0 Answers0