Skip to content

Instantly share code, notes, and snippets.

View xenonnsmb's full-sized avatar

xenonnsmb

View GitHub Profile

Keybase proof

I hereby claim:

  • I am xenonnsmb on github.
  • I am xenonnsmb (https://keybase.io/xenonnsmb) on keybase.
  • I have a public key ASCdW6wwBP1w2bRCxqJEIWUUUUReXlQr4tf7mL0OhcxPYwo

To claim this, I am signing this object:

@xenonnsmb
xenonnsmb / collapse.js
Created February 17, 2017 13:54
Simple script to make text collapsable via a link.
//collapsable text, by xenonnsmb
// how to use this: 1. make a link that links to javascript:toggleShow();
// 2. give it the id 'toggleLink'
// 3. give the element to be collapsed the id 'collapse'
// 4. insert this script in your <body> after both elements appear
var toggleLink = document.getElementById("toggleLink");
var collapseObject = document.getElementById("collapse");
var originalText = collapseObject.innerHTML;
collapseObject.innerHTML = '';
function toggleShow() {