1/* get the button id "tg" which is used for toggling.Then on click few
2elements with classname "adv" will disappear and at the same time few elements
3with classname "btnpro" will increase in width to 80px*. Upon second click
4elements with "adv" will appear again and the button width changes to 60px*/
5
6document.getElementById("tg").onclick = function ()
7{
8 my_fun1();
9 my_fun2();
10}
11
12function my_fun1()
13{
14 var x = document.getElementsByClassName("adv")
15 for(var i=0; i<x.length;i++) {
16 if (x[i].style.display === "none") {
17 x[i].style.display = "block"
18 flag = false
19 } else {
20 x[i].style.display = "none"
21 flag = true
22 }
23 }
24}
25
26function my_fun2()
27{
28 var x = document.getElementsByClassName("btnpro")
29 for(var i=0; i<x.length;i++) {
30 if(flag){
31 x[i].style.width = "80px";
32 }else{
33 x[i].style.width = "60px";
34 }
35 }
36}