I want to turn grid from diagram visible and invisible

I m having trouble in making grid visible and invisible by a js function

it turns off the grid but doesn’t turn back on the grid consider the diagram gird from fig

It’s always dangerous to use the assignment operator within a conditional expression.

so what better way is there to togle the grid of diagram via html button

I was warning you about using assignment within the conditional expression.

if (myDiagram.grid.visible) myDiagram.grid.visible = false; else myDiagram.grid.visible = true;

OR better yet:

myDiagram.grid.visible = !myDiagram.grid.visible;

holy my bad didnt see that thanx anyways