Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

292
Views
How to set an elements initial state to be hidden?

I use an extention that allows me to edit the css of Youtube. I need the navigation menu on the left of youtube home page to be hidden when the webpage loads and appear when the menu button is clicked.

This is how it looks now

Is there any way I can do this?

The extention can use Javascript too.

HTML code when the bar is open:

<tp-yt-app-drawer id="guide" align="start" role="navigation" class="style-scope ytd-app" style="transition-duration: 0ms; touch-action: pan-y;" position="left" swipe-open="" opened="" persistent="">

HTML code when the bar is closed:

<tp-yt-app-drawer id="guide" align="start" role="navigation" class="style-scope ytd-app" style="transition-duration: 0ms; touch-action: pan-y;" position="left" swipe-open="" persistent="">

HTML code of the button

<yt-icon-button id="guide-button" toggleable="true" class="style-scope ytd-masthead"><!--css-build:shady--><button id="button" class="style-scope yt-icon-button" aria-label="Guide" aria-pressed="true">
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Hope this helps?

document.getElementById("guide-button").onclick = function() {  
  myFunction() 
}; 
function myFunction() {
  var x = document.getElementById("guide");
  if (x.style.display === "none") {
    x.style.display = "block";
  } else {
    x.style.display = "none";
  }
}
<tp-yt-app-drawer id="guide" align="start" role="navigation" class="style-scope ytd-app" style="transition-duration: 0ms; touch-action: pan-y; display:none;" position="left" swipe-open="" opened="" persistent="">

<yt-icon-button id="guide-button" toggleable="true" class="style-scope ytd-masthead"><!--css-build:shady--><button id="button" class="style-scope yt-icon-button" aria-label="Guide" aria-pressed="true">

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!