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 20 html MCQ with Answers


 

Top 20 HTML  MCQ With Answers 



1] <form> tag  specifies where to send form data

A) action
B) enctype
C)method
D) target

Answer: A) action

2] <form> tag specifies how form data should be sent?

A) enctype
B) method  action
C) method 
D) name

Answer: C) method

3] What are the valid value for the method attribute


A) get, send
B)send, receive
C) get, post
D) send, post 

Answer: C) get, post

3] default method if the method attribute is not specified?

A) POST  DELETE
B) PUT
C) GET
D) POST 

Answer: C) GET

4] Which input type is use for passwords?

A) text
B) password
C) secure
D) pass

Answer: B) password

5] Which element is used to create a dropdown menu in a form?

A) <dropdown>
B) <select>
C) <option>
D) <checkbox>

Answer: B) <select>

6] Which attribute makes an input field required?

A) required
B) mustfill
C) validate
D) mandatory

Answer: A) required

7] What input type allow users to select multiple options?

A) checkbox
B)  button
C) text
D) radio

Answer: A) checkbox

8] What does the name attribute in an input tag 

A) Gives a unique ID
B) Defines a CSS class
C) Identifies the input when sending data
D) Specifies the type of input

Answer: C) Identifies the input when sending data

9] create a multi-line text input field

A) <textarea>
B) <paragraph>
C) <text>
D) <paragraph>

Answer: A) <textarea>

11]  Which tag groups form element together?

A) <group>
B) <fieldset>
C)  <section>
D) <formgroup>

Answer: B) <fieldset>

12] What does the <legend>  

A)   Adds a title to a form
B) Groups options in a dropdown
C) Provides a caption for <fieldset>
D) Defines a label for an input 

Answer: C) Provides a caption for <fieldset>

13] Which tag is use to define a label for an input field

A) <text>
B) <name>
C) <label>
D) <input>

Answer: C) <label>

15] How do you associate a label with an input field

A) Using for attribute in <label>
B) Using id attribute in <input>
C) Both A and B

Answer: C) Both A and B

16] input type restricts users to selecting a date

A) text
B)  datetime
C) calendar
D) date

Answer: B) date

17] Which attribute sets a maximum value for an input field

A) max
B)   value
C) limit
D) maximum

Answer: A) max

 18] input type is used for numeric input

A) number
B) numeric
C) tex
D)  integer

Answer: A) number

 19] What does the <ol> tag stand

A) Ordered Listing

B) Ordered Link

C) Ordered List

D) Online List

Answer: C) Ordered List

20] Which tag is use to define an item inside an ordered list

A) <item>

B) <ol>

C) <li>

D) <ul>

Answer: C) <li>

Comments

Popular posts from this blog

HTML Tag

CSS Text Color Explained with Syntax and HTML Examples

CSS Outline Offset Property with Practical Examples