Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
This data tree is comprised of clickable buttons and I want to expose all branches, in a single action, instead of clicking each vertical arrow button anew. I have tried the following code which d...
#4: Post edited
[This data tree](https://www.mediawiki.org/wiki/Special:CategoryTree?target=Category%3AConfigure&mode=all&namespaces=) is comprised of clickable buttons with _three or more_ branches and I want to expose all data (all branches), **in a single action**, instead of clicking each _vertical arrow_ button anew.As can be read in the linked webpage, one can click the _vertical arrow_ to get the next branch (if there is one).- I have tried the following code which didn't work (it will only toggle and untoggle the first and second branches).
- ```javascript
- document.querySelectorAll(".CategoryTreeToggle").forEach((element)=>{
- window.setInterval(()=>{
- if (element.getAttribute('data-ct-state', 'collapsed') ) {
- element.click();
- }
- }, 1000);
- });
- ```
- How to uncollapse an entire link tree with JavaScript?
- [This data tree](https://www.mediawiki.org/wiki/Special:CategoryTree?target=Category%3AConfigure&mode=all&namespaces=) is comprised of clickable buttons and I want to expose all branches, **in a single action**, instead of clicking each _vertical arrow_ button anew.
- I have tried the following code which didn't work (it will only toggle and untoggle the first and second branches).
- ```javascript
- document.querySelectorAll(".CategoryTreeToggle").forEach((element)=>{
- window.setInterval(()=>{
- if (element.getAttribute('data-ct-state', 'collapsed') ) {
- element.click();
- }
- }, 1000);
- });
- ```
- How to uncollapse an entire link tree with JavaScript?
#3: Post edited
How to expose an entire link tree with JavaScript?
- How to uncollapse an entire link tree with JavaScript?
- [This data tree](https://www.mediawiki.org/wiki/Special:CategoryTree?target=Category%3AConfigure&mode=all&namespaces=) is comprised of clickable buttons with _three or more_ branches and I want to expose all data (all branches), **in a single action**, instead of clicking each _vertical arrow_ button anew.
- As can be read in the linked webpage, one can click the _vertical arrow_ to get the next branch (if there is one).
- I have tried the following code which didn't work (it will only toggle and untoggle the first and second branches).
- ```javascript
- document.querySelectorAll(".CategoryTreeToggle").forEach((element)=>{
- window.setInterval(()=>{
- if (element.getAttribute('data-ct-state', 'collapsed') ) {
- element.click();
- }
- }, 1000);
- });
- ```
How to expose an entire link tree with JavaScript?
- [This data tree](https://www.mediawiki.org/wiki/Special:CategoryTree?target=Category%3AConfigure&mode=all&namespaces=) is comprised of clickable buttons with _three or more_ branches and I want to expose all data (all branches), **in a single action**, instead of clicking each _vertical arrow_ button anew.
- As can be read in the linked webpage, one can click the _vertical arrow_ to get the next branch (if there is one).
- I have tried the following code which didn't work (it will only toggle and untoggle the first and second branches).
- ```javascript
- document.querySelectorAll(".CategoryTreeToggle").forEach((element)=>{
- window.setInterval(()=>{
- if (element.getAttribute('data-ct-state', 'collapsed') ) {
- element.click();
- }
- }, 1000);
- });
- ```
- How to uncollapse an entire link tree with JavaScript?
#2: Post edited
I have a data tree comprised of clickable buttons with _three or more_ branches and I want to expose all data (all branches), **in a single action**, instead of clicking each _vertical arrow_ button anew.* [HTML example is available here](https://www.mediawiki.org/wiki/Special:CategoryTree?target=Category%3AConfigure&mode=all&namespaces=).- As can be read in the linked webpage, one can click the _vertical arrow_ to get the next branch (if there is one).
I have tried the following code which didn't work (it will only toggle and untoggle the first and second tiers).- ```javascript
- document.querySelectorAll(".CategoryTreeToggle").forEach((element)=>{
- window.setInterval(()=>{
- if (element.getAttribute('data-ct-state', 'collapsed') ) {
- element.click();
- }
- }, 1000);
- });
- ```
- How to expose an entire link tree with JavaScript?
- [This data tree](https://www.mediawiki.org/wiki/Special:CategoryTree?target=Category%3AConfigure&mode=all&namespaces=) is comprised of clickable buttons with _three or more_ branches and I want to expose all data (all branches), **in a single action**, instead of clicking each _vertical arrow_ button anew.
- As can be read in the linked webpage, one can click the _vertical arrow_ to get the next branch (if there is one).
- I have tried the following code which didn't work (it will only toggle and untoggle the first and second branches).
- ```javascript
- document.querySelectorAll(".CategoryTreeToggle").forEach((element)=>{
- window.setInterval(()=>{
- if (element.getAttribute('data-ct-state', 'collapsed') ) {
- element.click();
- }
- }, 1000);
- });
- ```
- How to expose an entire link tree with JavaScript?
#1: Initial revision
How to expose an entire link tree with JavaScript?
I have a data tree comprised of clickable buttons with _three or more_ branches and I want to expose all data (all branches), **in a single action**, instead of clicking each _vertical arrow_ button anew. * [HTML example is available here](https://www.mediawiki.org/wiki/Special:CategoryTree?target=Category%3AConfigure&mode=all&namespaces=). As can be read in the linked webpage, one can click the _vertical arrow_ to get the next branch (if there is one). I have tried the following code which didn't work (it will only toggle and untoggle the first and second tiers). ```javascript document.querySelectorAll(".CategoryTreeToggle").forEach((element)=>{ window.setInterval(()=>{ if (element.getAttribute('data-ct-state', 'collapsed') ) { element.click(); } }, 1000); }); ``` How to expose an entire link tree with JavaScript?