I have a simple script to hide/show a table row. I’d like it to look for an additional class, but I can seem to get it to work. Here is the original:
jQuery(function () {
jQuery(".toggle").click(function () {
jQuery(this).closest("tr").next("tr").find(".hide1").slideToggle("none");
});
});
I tried adding an ‘or’ operator to specify another class, but that doesn’t work:
jQuery(function () {
jQuery(".toggle").click(function () {
jQuery(this).closest("tr").next("tr").find(".hide1" || ".hide2").slideToggle("none");
});
});
Can someone point out my error – Javascript is not my strong suit.
Use a comma. This is the multiple selector.
Doing…
…is valid code, but it will be interpreted as…