Skip to content

Instantly share code, notes, and snippets.

@divinity76
Created September 5, 2016 11:03
Show Gist options
  • Save divinity76/a39e3beb1745a1d7317bb1daac729466 to your computer and use it in GitHub Desktop.
Save divinity76/a39e3beb1745a1d7317bb1daac729466 to your computer and use it in GitHub Desktop.
// http://www.multicom.no/gaming-laptop/cat-c/c1000042
(function() {
"use strict";
var all = document.querySelectorAll("#content > table.b-parts-list > tbody > tr[valign=top]");
var clickfunc = function(ev) {
var ele = ev.target.parentNode.parentNode;
ele.nextSibling.parentNode.removeChild(ele.nextSibling);
ele.nextSibling.parentNode.removeChild(ele.nextSibling);
ele.nextSibling.parentNode.removeChild(ele.nextSibling);
ele.parentNode.removeChild(ele);
//ele.parentNode.removeChild(ele);
//ele2.parentNode.removeChild(ele2);
//console.log("ele:",ele,"ele2:",ele2);
};
var butt;
for (var i = 0; i < all.length; ++i) {
butt = document.createElement("button");
butt.textContent = "hide";
butt.addEventListener("click", clickfunc);
all[i].firstChild.nextSibling.nextSibling.nextSibling.appendChild(butt);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment