Currently as I'm displaying different elements with jQuery, I'm re-creating them from scratch and adding them to the page.
I've come to a point where I want the user to be able to check a box on one element, then click a button to see some different information, then be able to switch back and see the earlier box still checked.
Since I'm currently making new elements each time the user switches, this isn't possible in a straightforward manner.
I'm wondering whether it's better to redraw the elements or to modify the CSS display
property.
I could see why it would be helpful to hide elements but I'm not sure it's necessary to keep ~150 elements on the screen and just have them not displayed.
This is what I have so far:
https://jsfiddle.net/W4Km8/7767/
This code changes the color of information rows:
$("#table").on("click", ".on", function() {
$(this).removeClass("on");
$(this).addClass("off");
});
$("#table").on("click", ".off", function() {
$(this).addClass("on");
$(this).removeClass("off");
});
The problem is that if you look at another set of information rows and then come back, the row colors are reset.