I really appreciate your efforts, Mr rpg, and i know you are doing more than a contributor for me. Here is below my final code for my first three section’s button, I really appologies for the inconvinence caused by my questions.
[3:1] First button
<html>
<button id="Mybutton1" onclick='hideSections()'>[3:1]</button>
<style>
#Mybutton1 {
background-color: green;
color: white;
width: 50px;
text-align: center;
border-radius: 8px;
height: 35px;
border-style: solid;
border-color: blue;
border-width: 1px;
}
#Mybutton1:hover {
background-color: grey;
}
.hide {
display: none;
}
.hideWithOpacity {
visibility: hidden;
opacity: 0;
}
</style>
<div id='Ayat-2' class="hideSections"></div>
<div id='Ayat-3' class="hideSections"></div>
<div id='Ayat-4' class="hideSections"></div>
<div id='Ayat-5' class="hideSections"></div>
<div id='Ayat-6' class="hideSections"></div>
<div id='Ayat-7' class="hideSections"></div>
<div id='Ayat-8' class="hideSections"></div>
<div id='Ayat-9' class="hideSections"></div>
<div id='Ayat-10' class="hideSections"></div>
<div id='Ayat-11' class="hideSections"></div>
<div id='Ayat-12' class="hideSections"></div>
<div id='Ayat-13' class="hideSections"></div>
<div id='Ayat-14' class="hideSections"></div>
<div id='Ayat-15' class="hideSections"></div>
<script>
function hideSections() {
const otherSections = document.querySelectorAll('#Ayat-2,#Ayat-3,#Ayat-4,#Ayat-5,#Ayat-6,#Ayat-7,#Ayat-8,#Ayat-9,#Ayat-10,#Ayat-11,#Ayat-12,#Ayat-13,#Ayat-14,#Ayat-15');
otherSections.forEach((section) => section.classList.toggle('hide'))
}
</script>
</html>
[3:2] Second button code with change in property names and tags for script and html.
<html>
<button id="Mybutton2" onclick='hideSectionsTwo()'>[3:2]</button>
<style>
#Mybutton2 {
background-color: green;
color: white;
width: 50px;
text-align: center;
border-radius: 8px;
height: 35px;
border-style: solid;
border-color: blue;
border-width: 1px;
}
#Mybutton2:hover {
background-color: grey;
}
.hide {
display: none;
}
.hideWithOpacity {
visibility: hidden;
opacity: 0;
}
</style>
<section2 id='Ayat-1' class="hideSectionsTwo"></section2>
<section2 id='Ayat-3' class="hideSectionsTwo"></section2>
<section2 id='Ayat-4' class="hideSectionsTwo"></section2>
<section2 id='Ayat-5' class="hideSectionsTwo"></section2>
<section2 id='Ayat-6' class="hideSectionsTwo"></section2>
<section2 id='Ayat-7' class="hideSectionsTwo"></section2>
<section2 id='Ayat-8' class="hideSectionsTwo"></section2>
<section2 id='Ayat-9' class="hideSectionsTwo"></section2>
<section2 id='Ayat-10' class="hideSectionsTwo"></section2>
<section2 id='Ayat-11' class="hideSectionsTwo"></section2>
<section2 id='Ayat-12' class="hideSectionsTwo"></section2>
<section2 id='Ayat-13' class="hideSectionsTwo"></section2>
<section2 id='Ayat-14' class="hideSectionsTwo"></section2>
<section2 id='Ayat-15' class="hideSectionsTwo"></section2>
<script>
function hideSectionsTwo() {
const otherSectionsTwo = document.querySelectorAll('#Ayat-1,#Ayat-3,#Ayat-4,#Ayat-5,#Ayat-6,#Ayat-7,#Ayat-8,#Ayat-9,#Ayat-10,#Ayat-11,#Ayat-12,#Ayat-13,#Ayat-14,#Ayat-15');
otherSectionsTwo.forEach((section2) => section2.classList.toggle('hide'))
}
</script>
</html>
[3:3] Third button code with change in property names and tags for script and html.
<html>
<button id="Mybutton3" onclick='hideSectionsThree()'>[3:3]</button>
<style>
#Mybutton3 {
background-color: green;
color: white;
width: 50px;
text-align: center;
border-radius: 8px;
height: 35px;
border-style: solid;
border-color: blue;
border-width: 1px;
}
#Mybutton3:hover {
background-color: grey;
}
.hide {
display: none;
}
.hideWithOpacity {
visibility: hidden;
opacity: 0;
}
</style>
<section3 id='Ayat-1' class="hideSectionsThree"></section3>
<section3 id='Ayat-2' class="hideSectionsThree"></section3>
<section3 id='Ayat-4' class="hideSectionsThree"></section3>
<section3 id='Ayat-5' class="hideSectionsThree"></section3>
<section3 id='Ayat-6' class="hideSectionsThree"></section3>
<section3 id='Ayat-7' class="hideSectionsThree"></section3>
<section3 id='Ayat-8' class="hideSectionsThree"></section3>
<section3 id='Ayat-9' class="hideSectionsThree"></section3>
<section3 id='Ayat-10' class="hideSectionsThree"></section3>
<section3 id='Ayat-11' class="hideSectionsThree"></section3>
<section3 id='Ayat-12' class="hideSectionsThree"></section3>
<section3 id='Ayat-13' class="hideSectionsThree"></section3>
<section3 id='Ayat-14' class="hideSectionsThree"></section3>
<section3 id='Ayat-15' class="hideSectionsThree"></section3>
<script>
function hideSectionsThree() {
const otherSectionsThree = document.querySelectorAll('#Ayat-1,#Ayat-2,#Ayat-4,#Ayat-5,#Ayat-6,#Ayat-7,#Ayat-8,#Ayat-9,#Ayat-10,#Ayat-11,#Ayat-12,#Ayat-13,#Ayat-14,#Ayat-15');
otherSectionsThree.forEach((section3) => section3.classList.toggle('hide'))
}
</script>
</html>
After a long search and hours of finding the reason I came to know that conflict was with multiple html button properties which I was overlooked , when I change each button individually and start to go line by line I came to know that I am referencing the same tag names and id’s in all buttons which causes the button to behave randomly.
Anyhow the code is ready as per my requirement and once again I want to say sorry if any problem caused by me and really really appreciate your efforts GOD Bless you. The issue is now being CLOSED.
We will meet soon in another query. Hope you will assist me also there, this time it will be angular.