how to run p5js in a particular section of page

JavaScript
var myCanvas = createCanvas(winWidth, winHeight);
    myCanvas.parent("idnameofdiv");

Source

Also in JavaScript: