learning-zone / html-basics Goto Github PK
View Code? Open in Web Editor NEWHTML Basics ( HTML-5 )
Home Page: https://learning-zone.github.io/html-interview-questions/
HTML Basics ( HTML-5 )
Home Page: https://learning-zone.github.io/html-interview-questions/
Description:
The provided HTML code contains examples of various shapes drawn using HTML5 Canvas. While the code demonstrates how to draw text, lines, rectangles, and circles on a canvas, there are several issues and improvements that can be addressed:
Inconsistent Naming: The canvas elements are named inconsistently (e.g., "text", "line", "rectangle", "rect", "circle"). Consistent naming conventions should be used to improve readability and maintainability.
Canvas Size: The canvas element for the "line" shape has its height set to 0, which results in a line not being visible. The canvas size should be adjusted to display the line properly.
Error Handling: The canvas elements for "rectangle" and "circle" have fallback text ("This browser does not support Canvas!"), but no such fallback is provided for the "text" and "line" elements. Consistent error handling should be implemented for all canvas elements.
Fixed code since getElementById is not working
According to mdn we can use querySelector -
-> https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes
const article = document.querySelector("#electric-cars");
article.dataset.columns; // "10"
article.dataset.indexNumber; // "100"
article.dataset.parent; // "cars"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.