designs.js
// When size is submitted by the user, call makeGrid()
When size is submitted by the user, call makeGrid()
When size is submitted by the user call makeGrid ()
function makeGrid()
{
  let gridHeight = INPUT_HEIGHT.val();
  let gridWidth = INPUT_WIDTH.val();
  CANVAS_GRID_TABLE.empty();
  for (let i = 0; i < gridHeight; i++)
  {
    const cell = $("<tr></tr>");
    CANVAS_GRID_TABLE.append(cell);
    for (let j = 0; j < gridWidth; j++)
    {
      cell.append("<td></td>");
    }
  }
  $("td").on("click", function()
  {
    const color = $("#colorPicker").val();
    $(this).css("background-color", color);
  });
} 
function makeGrid ( ) { let gridHeight = INPUT_HEIGHT . val ( ) ; let gridWidth = INPUT_WIDTH . val ( ) ; CANVAS_GRID_TABLE . empty ( ) ; for ( let i = 0 ; i < gridHeight ; i ++ ) { const cell = $ ( "<tr></tr>" ) ; CANVAS_GRID_TABLE . append ( cell ) ; for ( let j = 0 ; j < gridWidth ; j ++ ) { cell . append ( "<td></td>" ) ; } } $ ( "td" ) . on ( "click" , function ( ) { const color = $ ( "#colorPicker" ) . val ( ) ; $ ( this ) . css ( "background-color" , color ) ; } ) ; }
When size is submitted by the user, call makeGrid()
When size is submitted by the user call makeGrid ()
// Set CANVAS_GRID_TABLE size as N by M grid // Clear the CANVAS_GRID_TABLE first // rows // cols //Select color input // END OF FUNCTION makeGrid()