/** * Created by Nigel on 9/11/2015. */ var color1 = "#ddddcc"; var color_highlight_01 = "yellow"; var highlight_state = "none"; function highlight_set(skills){ console.log("highlighting... for " + skills + "\n"); var nodes = document.querySelectorAll('.lineitem'); console.log(nodes.length + " nodes in total...\n"); for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; node.style.backgroundColor=color1; } if (highlight_state == skills) { highlight_state = "none"; return; } highlight_state = skills; var snodes = document.querySelectorAll(".lineitem[skillset~='" + skills + "']"); console.log(snodes.length + " specific nodes in total...\n"); for (var i = 0; i < snodes.length; i++) { var node = snodes[i]; node.style.backgroundColor="yellow"; } } function highlight_clear() { var nodes = document.querySelectorAll('.lineitem'); for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; node.style.backgroundColor=color1; } }