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

Top 15 HTML  MCQ With Answers 





1] What is the purpose of the <a> 

A)  To insert images
B) To define a paragraph
C) To create a hyperlink
D) To create headings

Answer: C) To create a hyperlink

 2] <a> tag specifies URL of the link destination

A) link
B)  src
C)  url
D) href

Answer: D) href

3] Which of the  NOT a valid target value for the <a> tag 

A) _parent
B) _top
C) _newtab
D) _self

Answer: C) _newtab

4] Which tag is commonly used with <a>  tag to define navigation link?

A) <nav>
B) <section>
C) <header>
D) <footer>

Answer: A) <nav>

5] What attribute is used to group radio buttons 

A) value
B) group
C) name
D) id

Answer: C) name

6] How can you hide a radio button but functional?

A) display: none;
B) visibility: hidden;
C) opacity: 0;
D) Both A and C

Answer: D) Both A and C

7]  HTML element for creating a dropdown list?

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

Answer: C) <select>

8] Which tag is usedto define individual items inside a dropdown 

A) <list>
B) <option>
C) <dropdown-item>
D) <item>

Answer: B) <option>

9] Which attribute defines the default value submitted with a dropdown LIST ?

A) value
B) default
C) selected
D) name

Answer: A) value

10] assign a name to a dropdown in a form?

A) Use id="dropdown"
B) Use name="dropdown"
C) Use label="dropdown"
D) Use value="dropdown"

Answer: B) Use name="dropdown"

11] How can you group related options in a dropdown 

A) Using <group>
B) Using <fieldset>
C) Using <optgroup>
D) Using <category>

Answer: C) Using <optgroup>

12] How can you create a dropdown with a custom button instead of a <select> ?

A) Using <button> and JavaScript
B) Using <input type="dropdown">
C) Using <menu> and <option>
D) Using <drop-button>

Answer: A) Using <button> and JavaScript

13] How can you prevent use from selecting a particular option  dropdown?

A) Add disabled to the <option>
B) Add hidden to the <option>
C) Add readonly to the <option>
D) Both A and B

Answer: D) Both A and B

14]  HTML tag to create a file upload input?

A) <upload>
B) <file>
C) <input type="file">
D) <input type="upload">

Answer: C) <input type="file">

15] Which attribute is required for selecting multiple files in  upload field?

A) multiple
B) multiselect
C) select="multiple"
D) multi-file

Answer: A) multiple

Related  Post :-

php if else statements

php program to print alphabet pattern U

javascript Tutorial

Comments

Popular posts from this blog

HTML Tag

CSS Text Color Explained with Syntax and HTML Examples

CSS Outline Offset Property with Practical Examples