Correct Answer: C
Using HTML, users can upload files from their computer to a web page using the<input>element with thetype="file"attribute.
* File Upload Input: The<input type="file">element is used in forms to allow users to select files from their local file system to be uploaded to a server.
* Usage Example:
The<canvas>element in HTML5 is used to render images and graphics dynamically through JavaScript. It is a powerful feature for creating graphics, game visuals, data visualizations, and other graphical content directly in the browser.
* Canvas Element: The<canvas>element is an HTML tag that, with the help of JavaScript, can be used to draw and manipulate graphics on the fly.
* Usage Example:
html
Copy code
<canvas id="myCanvas" width="200" height="100"></canvas>
<script>
var canvas = document.getElementById("myCanvas");
var ctx = canvas.getContext("2d");
ctx.fillStyle = "#FF0000";
ctx.fillRect(0, 0, 200, 100);
</script>
In this example, a red rectangle is drawn on a canvas element.
:
MDN Web Docs on<canvas>
W3C HTML Canvas 2D Context Specification
<form action="/upload" method="post" enctype="multipart/form-data">
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload File" name="submit">
</form>
In this example, users can choose a file from their computer and upload it to the specified server endpoint.
References:
MDN Web Docs on<input type="file">
W3C HTML Specification on File Upload