Conditional Rendering in React Complete Guide with Examples 2026

Image
  Conditional Rendering in React Conditional Rendering is one of the most useful concepts in React. It means showing different content on the screen depending on a condition. For example: If a user is logged in → show Logout If a user is not logged in → show Login If a student has passed → show Congratulations If a product is available → show Buy Now If data is loading → show Loading... React does not have a separate if rendering tag. Instead, we use normal JavaScript conditions such as if, the ternary operator, &&, and switch to decide what should appear in the UI.

Top 20 HTML MCQ with Answers (part 1)

                TOP  20 HTML MCQ with Answers

TOP  20 HTML MCQ with Answers

1]  What  is HTML stand for?

     a] Hyper transfer markup language
     b] Hyper Text Markup language
     c] Hyper test Markup langauge
     d] Hyper text Markup langauge
 
Answer : b] Hyper text Markup language

2]  HTML  element for the largest heading?
    
    a) <head>
    b) <h6>
    c)  <h1>
    d)  <h4>

 Answer : c) <h1>

3] HTML element for insert line break?
  
  a) <br>
  b) < line>
  c) <insert>
  d) <break>

 Answer :  a) <br>

4] Syntax HTML comment?
 
a)  //comment
b)  #comment
c)  /* comment*/
d)  <!--comment-->

Answer : - d)  <!--comment-->

5] which html tag element defines title of the document?
  
  a) <html>
  b)  <head>
  c) <meta>
  d) <title>

 Answer : -  d) <title>

6] HTML for creating a hyperlink?

  a) <a href="http://www.example.com">example</a>
  b) <a src="http://www.example.com  >example</a>
  c) <a href="http://www.example.com >example</a>
  d)  <a href= http://www.example.com >example</a>

Answer :- a) <a href="http://www.example.com">example</a>


7)  HTML  tag is called the root element of html?

  a) <title> 
  b) <head>
  c) <html>
  d) <body>

Answer :-   c) <html>

8) HTML is case sensitive ?
  
 a) Yes
  b) No

 Answer :-   b) No

9) which of the properties is used to change the font  of text?
 
  a) font-family
  b) font-size
  c) none 
  b) text-align

Answer :-   a) font-family

10) Create HTML page?

 a) web Browser
 b) a text editor
 c) A ans B Both
 d) none

Answer :-   c) A ans B Both

11) which property is used set border colors in html ?
 
 a) border
 b) border-color
 c) both  A &B
 d) none of the above

Answer :-   b) border-color

12)  which property is used to set colors in html?

a) font-color 
b) background-color
c) color
d) text-color

Answer : - c) color

13) what tag is used to render an image on a webpage?

 a) img
 b) image
 c)  src
 d) none
 
Answer :   a) img

14) what  attribute is used provide a unique name html element?

a) class
b) id 
c) type 
d) none

Answer :  b) id 

15) what   html tag used set up javascript client-side scriping language ?

 a) <anchor>
 b) <script>
 c) <select>
 d) none
 
Answer :   b) <script>

16)  block-level elements in html?

 a)  <p>
 b) <h1>
 c) <div>
 d) all above

Answer :  d) all above

 17)  color are defined HTML using?
  
   a) RGBA values
   b) RGB values
   c) HEX values 
   d) all  of the above 

Answer :  d) all  of the above 

18)  How are quotations defined in html?

 a) <blockquote>
 b) <block>
 c) <quote>
 d)  none

Answer :   a) <blockquote>

19)  how many characters can be written in 1KB?

 a) 1048
 b) 1024
 c)  100
 d) 1058

Answer :  a) 1048

20) how many sizes of headers available in HTML by default?
 
 a) 4
 b) 6
 c) 1
 d) 3

Answer :  b) 6


Related Post :-

php data type


Comments

Popular posts from this blog

HTML Tag

CSS Text Color Explained with Syntax and HTML Examples

HTML Input Type Submit Syntax and Example