Create Your First Functional Component in React JS – Beginner's Guide

Image
Create Your First Functional Component in React JS  1. Introduction When you start learning React JS, one of the first things you will come across is the concept of components. At first, components may seem like just another programming concept, but they are actually the foundation of almost every React application. Think about a website you use every day. It may have a header, navigation menu, login form, product section, and footer. Instead of writing all these elements together in one large file, React allows us to create separate parts and manage them independently. These separate parts are called components. In this tutorial, we are going to create our first functional component in React. We will start with a very simple example and gradually understand how components are created, exported, imported, and displayed on a webpage.  2. What Is a Functional Component in React?   A functional component is simply a JavaScript function that returns a user interface using JSX...

Top 10 HTML MCQ

  

Top 10 HTML  MCQ With Answers 


Top 10 HTML  MCQ With Answers part(10)

1] Where should the <script> tag be placed when linking an                                       external JavaScript file?

A) Inside <head>
B) Inside <body>
C) Before </html>
D) Any of the above

Answer: D) Any of the above


2] How do you correctly link an external JavaScript ?

A) <script src="script.js"></script>
B) <link rel="script" href="script.js">
C) <meta script="script.js">
D) <js src="script.js"></js>

Answer: A) <script src="script.js"></script>


3] Which tag is use to define the favicon for a website?

A) <meta icon>
B) <favicon>
C) <link rel="icon">
D) <icon> 

Answer: C) <link rel="icon">


4] What file types are commonly use for favicons?

A) .png
B) .ico
C) .svg
D) All of the above

Answer: D) All of the above


5] What is the default size of  favicon?

A) 16x16
B) 32x32
C) 64x64
D) 128x128

Answer: A) 16x16


6] Why is the  important<meta charset="UTF-8"> tag ?

A) Ensures proper character encoding
B) Loads stylesheets faster
C) Increases SEO ranking
D) Prevents broken links

Answer: A) Ensures proper character encoding


7] What does the <base> tag do in the <head> tag?

A) Sets the base URL for all relative links
B) Defines the primary content
C) Sets the background color
D) Specifies the document type

Answer: A) Sets the base URL for all relative links


8] What happens if the <title> tag is missing from the <head> tag?

A) The browser shows a blank tab title
B) The file name is displayed as the title
C) The webpage doesn’t load
D) The browser crashes

Answer: B) The file name is displayed as the title

9) How do you make a frame load a default web page?

a) By using the src attribute
b) By using the href attribute
c) By using the load attribute
d) By using the default attribute

Answer: a) By using the src attribute

10] What happens if the cols and rows attributes are not specified in a <frameset>?

a) The browser displays a blank page
b) Frames take up equal space by default
c) Frames do not appear
d) Frames are automatically hidden

Answer: b

Comments

Popular posts from this blog

HTML Tag

CSS Text Color Explained with Syntax and HTML Examples

CSS Outline Offset Property with Practical Examples