p5.js | createA() Function Last Updated : 26 Nov, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report The createA() function in p5.js is used to create an anchor element in the DOM (Document Object Model) for creating a hyperlink. This function includes the p5.dom library. Add the following syntax in the head section. html <script src= "https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.11/addons/p5.dom.min.js"> </script> Syntax: createA( href, html, target ) Parameters: href: It holds the url of the page to the link.html: It holds the display text.target: It holds the target where the link will open. The "target" can be '_blank' (link will open in a new tab), '_self' (link will open in the same tab), etc.Example: This example uses createA() function to create a link of GeeksforGeeks home page. javascript // Create a variable for anchor object var link; function setup() { // Create a canvas createCanvas(400, 200); // Set the background-color background('green'); // Create a anchor object using createA() function link = createA("https://www.geeksforgeeks.org/", "Go to GeeksforGeeks", "_blank"); // Position the anchor objects link.position(120, 80); } Output: After clicking the link, GeeksforGeeks home page will open in a new tab.Reference: https://p5js.org/reference/#/p5/createA Comment More infoAdvertise with us Next Article p5.js | createA() Function S SujanDutta Follow Improve Article Tags : JavaScript Web Technologies JavaScript-p5.js Similar Reads p5.js createSpan() Function The createSpan() function is used to create a span element in the DOM with the given optional inner html. Syntax: createSpan([html]) Parameters: This function accepts a single parameter as mentioned above and described below: html: It is a string with the innerHTML of the span element. It 1 min read p5.js createAudio() Function The createAudio() function is used to create an audio element in the DOM. The audio is created as a p5.MediaElement, which has methods for controlling the media and its playback. Syntax: createAudio(src, callback) Parameters: This function accept two parameters as mentioned above and described below 2 min read p5.js createCamera() Function The createCamera() function in p5.js is used to create a p5.Camera object and tell the renderer to use it as the current camera. It returns the camera object it newly created. Syntax: createCamera() Parameters: This function accepts no parameters.Return Value: It returns a p5.Camera object that deno 2 min read p5.js createInput() Function The createInput() function is used to create an input element in the DOM for accepting text input. The optional parameters can be used to set the type of input that can be entered. You can use the set() function to define the length of the box. Syntax: createInput(value, type) Parameters: This func 2 min read p5.js createVideo() Function The createVideo() function is used to create a video element in the DOM. The video is created as a p5.MediaElement, which has methods for controlling the media and its playback. Syntax: createVideo(src, callback) Parameters: This function accepts two parameters as mentioned above and described below 2 min read Like