I am displaying a graph on my webpage and there is a button called "redraw". So i want to disable the button redraw once clicked till the graph is drawn and enable the redraw button again.. using javascript . The graph and button is on the same page This is my javascript
<script>
$("#myButton").on('click', function () {
$(this).prop('disabled', true);
$(this).toggleClass('green');
$("#result").toggle();
});
</script>