element.parent() isn't working - doesn't format anything on the webpage?

Viewed 34

Edit: Also should mention that I didn't write the js file...I just added the canvas.parent()line so I could integrate it with the rest of our website. This is a group project.

This might be a silly question but for some reason I can't get my canvas.parent() element to work. Any changes made to the container doesn't affect the position of the sketch on my page.

Here's the setup function from the sketch.js:

  var canvas = createCanvas(ww, hh);
  loadFlights();
  canvas.parent('visualization');
}

And here's the snippet from the HTML file:

<div class = "btns">
 <button onclick="createFlightFromForm()" class = "btn">Submit</button>
 <button onclick="save('myCanvas.jpg');" class ="btn">Save Map</button>
</div>
  
<div id='visualization'></div>

I'm very new to HTML/CSS/Javascript so any help would be appreciated!!

0 Answers
Related