Question: Table is given as

```
Food ID  | Food Review
1        | good Review
1        | good Review
1        | Bad Review
2        | good Review
2        | Bad Review
3        | Good Review

```

and the Output expected is

```
Food ID   | Good Review | All Review | Acceptance score
1         | 2           | 3          | 2/3

```

Acceptance score will be calculated as good Review/All Review

Can anyone please help me with the query ?

Answer: 
Instead of setting the style in each click, [toggle](http://api.jquery.com/toggleclass/) the class `$( "#toogle_menu" ).toggleClass( "toggled" )` and style this class in css

```js
$("#toogle_menu").click(function() {
  $("#jy_nav_pos_main").slideToggle("slow"),
    $("#toogle_menu").toggleClass("toggled")
});
```

```css
.toggled {
  transform: rotate(-90deg);
}
```

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<ul class="nav nav-tabs row margin_auto" id="jy_nav_pos_main" role="tablist">
  ......
</ul>
<button id="toogle_menu" class="btn btn-light">
&raquo;
</button>
```
Try this..

```js
var clicked = false;
$("#toogle_menu").click(function() {
 var deg = clicked ? 0 : -90;
  $("#jy_nav_pos_main").slideToggle("slow"),

    $("#toogle_menu").css({
      transform: "rotate("+deg+"deg)"
    });
    clicked = !clicked;
});
```

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<ul class="nav nav-tabs row margin_auto" id="jy_nav_pos_main" role="tablist">
  <li>menu</li>
</ul>
<button id="toogle_menu" class="btn btn-light">
    &raquo;
</button>
```