Skip to content

Instantly share code, notes, and snippets.

@nocodesupplyco
Created December 19, 2022 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nocodesupplyco/98bc1828be7d627d6bcf6a9749d07b10 to your computer and use it in GitHub Desktop.
Save nocodesupplyco/98bc1828be7d627d6bcf6a9749d07b10 to your computer and use it in GitHub Desktop.
Hide/show Based on URL Parameter
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
// If URL has "partner" do something
if (urlParams.has("partner")) {
var partnerBtn = document.getElementById("partner-btn");
partnerBtn.style.display = "inline-block";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment