Calculate area, the hypotenuse of the triangle, play a quiz based on the triangle and give three angles to decide if they form a triangle.
- Semantic HTML5 markup
- Sass - CSS extension language
- CSS Flexbox
- Vanilla JavaScript
Fun With triangles is multipage website. I learned multiple things in this project.
Node.insertBefore()
The Node.insertBefore()
insert a node before a reference node having the same parent element.
Syntax
parentNode.insertBefore(nodeToInsert, refernceNode);
- I learned to set attribute using JavaScript using
setAttribute()
method
Syntax
element.setAttribute("attributeName", "attributeValue");
- For the first time I worked with FormData API. In the quiz section of project, I used FormData API to evaluate the answers submitted by the user.
Example from Code
let formData = new FormData(quizForm);
let index = 0;
for (let value of formData) {
if (answers[index] == value[1]) {
score++;
}
index++;
}
- Twitter - @junaidshaikh_js
- Linkedin - @junaidshaikhjs