function fixHrefTarget(container) {
	  var tgtClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ":is-target";

	  var linksWithHash = container.querySelectorAll('a[href^="#"]');
	  var target = undefined;

	  function add(tgt, klass) {
	    tgt.classList.add(klass);
	  }
	  function rm(tgt, klass) {
	    tgt.classList.remove(klass);
	  }

	  linksWithHash.forEach(function (link) {
	    link.addEventListener(pointerClick, function (e) {
	      e.preventDefault();

	      // set new target
	      var newTgt = this.getAttribute("href");
	      if (newTgt != "#") {
	        target = container.querySelector(newTgt);

	        // remove or add new class
	        if (target.classList.contains(tgtClass)) rm(target, tgtClass);else add(target, tgtClass);
	      }
	    });
	  });
	}
/**
	 * fixHrefTarget
	 *  Mimics :target behaviour using class toggling.
	 *  in CSS use :is-target, instead of :target
	 */
fixHrefTarget
Mimics :target behaviour using class toggling.
in CSS use :is-target, instead of :target
fixHrefTarget Mimics : target behaviour using class toggling . in CSS use : is - target instead of : target
function fixHrefTarget(container) {
	  var tgtClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ":is-target";
	  var linksWithHash = container.querySelectorAll('a[href^="#"]');
	  var target = undefined;
	  function add(tgt, klass) {
	    tgt.classList.add(klass);
	  }
	  function rm(tgt, klass) {
	    tgt.classList.remove(klass);
	  }
	  linksWithHash.forEach(function (link) {
	    link.addEventListener(pointerClick, function (e) {
	      e.preventDefault();
	      var newTgt = this.getAttribute("href");
	      if (newTgt != "#") {
	        target = container.querySelector(newTgt);
	        if (target.classList.contains(tgtClass)) rm(target, tgtClass);else add(target, tgtClass);
	      }
	    });
	  });
	}
function fixHrefTarget ( container ) { var tgtClass = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : ":is-target" ; var linksWithHash = container . querySelectorAll ( 'a[href^="#"]' ) ; var target = undefined ; function add ( tgt , klass ) { tgt . classList . add ( klass ) ; } function rm ( tgt , klass ) { tgt . classList . remove ( klass ) ; } linksWithHash . forEach ( function ( link ) { link . addEventListener ( pointerClick , function ( e ) { e . preventDefault ( ) ; var newTgt = this . getAttribute ( "href" ) ; if ( newTgt != "#" ) { target = container . querySelector ( newTgt ) ; if ( target . classList . contains ( tgtClass ) ) rm ( target , tgtClass ) ; else add ( target , tgtClass ) ; } } ) ; } ) ; }
fixHrefTarget
  Mimics :target behaviour using class toggling.
fixHrefTarget Mimics : target behaviour using class toggling .
// set new target // remove or add new class