Answer the question
In order to leave comments, you need to log in
How to manually enable or disable script in cells?
The question is, there is a Sandbox
example with one cell, we have 10 of them, and they are all of this type.
We need the script to work in some cells, and be turned off in some cells, until the time comes to turn it on again. At the same time, turn off and turn on the script only through the first cell, which is in html.
Answer the question
In order to leave comments, you need to log in
You need a loop for each line. Inside the event listener's loop or any other function.
[].forEach.call(document.querySelectorAll('tr'), function(row){
var isOpen = true;
row.querySelector('.js-toggle').addEventListener('click', function(e){
isOpen = isOpen ? false : true
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question