Difference between revisions of "Template:Expand All"

From BTAWiki
Jump to navigation Jump to search
(Test)
 
m (Replaced content with "<div id="Expand all"></div>")
Tag: Replaced
Line 1: Line 1:
<button onclick="expand()">Expand all</button>
+
<div id="Expand all"></div>
<button onclick="collapse()">Collapse all</button>
 
<script>
 
function collapse() {
 
    var x = document.getElementsByClassName("mw-collapsible-text");
 
    var i;
 
    for (i = 0; i < x.length; i++) {
 
    if ( x[i].innerHTML == mw.message( 'collapsible-collapse' ).plain() ) {
 
        x[i].click(); }
 
    }
 
}
 
function expand() {
 
    var x = document.getElementsByClassName("mw-collapsible-text");
 
    var i;
 
    for (i = 0; i < x.length; i++) {
 
    if ( x[i].innerHTML == mw.message( 'collapsible-expand' ).plain() ) {
 
        x[i].click(); }
 
    }
 
}
 
</script>
 

Revision as of 00:19, 28 July 2021