All Exams  >   Class 3  >   HTML for Junior Classes  >   All Questions

All questions of HTML Forms for Class 3 Exam

Which attribute is used for activation of JavaScript?
  • a)
    button
  • b)
    checkbox
  • c)
    url
  • d)
    submit
Correct answer is option 'A'. Can you explain this answer?

Rahul Verma answered
Input type button is used for the activation of JavaScript on the clicking of the button. Its syntax is <input type=”button” value=”click” onclick=”source()”>. This will display a button named click and when we click that button JavaScript function source() will be invoked.

Which attribute is not used for the radio type?
  • a)
    name
  • b)
    value
  • c)
    checked
  • d)
    selected
Correct answer is option 'D'. Can you explain this answer?

Yash Banerjee answered
The correct answer is option 'D', which states that the attribute "selected" is not used for the radio type.

Explanation:
- The radio type in HTML is used to create a set of radio buttons, allowing users to select only one option from a list.
- Radio buttons are often used in forms where users need to choose a single option from multiple choices.
- To create a radio button, we use the tag with the "type" attribute set to "radio".
- The radio button has several attributes that can be used to define its behavior and appearance.
- Let's review the attributes mentioned in the question and explain their usage:

a) name attribute:
- The "name" attribute is used to specify the name of the radio button group.
- All radio buttons with the same name attribute belong to the same group.
- This attribute is important because it allows the browser to determine which radio buttons are related and enables the user to select only one option from the group.

b) value attribute:
- The "value" attribute is used to specify the value associated with the radio button.
- When the form is submitted, the selected radio button's value is sent to the server.
- The value attribute is important for processing user input.

c) checked attribute:
- The "checked" attribute is used to pre-select a radio button when the page loads.
- By default, none of the radio buttons are selected.
- Using the "checked" attribute, we can set a default selection for the radio button group.

d) selected attribute:
- The "selected" attribute is used with options in a dropdown list (

How image attribute works?
  • a)
    Sets an image background
  • b)
    Set an image as submit button
  • c)
    Set an image anywhere on the page
  • d)
    Bring default image to the page
Correct answer is option 'B'. Can you explain this answer?

Mihir Pillai answered
Setting an Image as a Submit Button
Setting an image as a submit button is a common practice in web development to customize the appearance of a form's submit button. This can be achieved using the 'image' attribute within the HTML 'input' tag.
  • Step 1: Create an HTML form with a submit button
  • Step 2: Use the 'input' tag with type 'image' attribute
  • Step 3: Specify the source of the image using the 'src' attribute
  • Step 4: Add alternative text for accessibility using the 'alt' attribute


By following these steps, you can set an image as a submit button on your web page. This allows you to customize the appearance of the button and enhance the overall design of your form.

How does the color attribute work?
  • a)
    Changes color of the text
  • b)
    Changes background color
  • c)
    The color picker is defined by it
  • d)
    Changes color of the text as well as background
Correct answer is option 'C'. Can you explain this answer?

Manoj Yadav answered
The color attribute in HTML is used to define the color of an element. It is an important attribute as it helps in enhancing the visual appeal and aesthetics of a webpage. The correct answer to this question is option 'C', which states that the color picker is defined by the color attribute. Let's explore this answer in detail.

The HTML color attribute is used to specify the color of the text or the foreground color of an element. It is defined using a set of hexadecimal values or predefined color names. The color attribute can be applied to various HTML elements such as headings, paragraphs, divs, spans, links, etc.

Explanation:
1. Changes color of the text: The color attribute can be used to change the color of the text within an element. By specifying a hexadecimal value or color name, the text will be displayed in that particular color. For example, if we set the color attribute to "#FF0000" (which represents red), the text within the element will be displayed in red color.

2. Changes background color: While the color attribute primarily changes the color of the text, it can also indirectly affect the background color of an element. When the color attribute is applied to an element, it may contrast with the default background color, making it appear as if the background color has changed. However, it is important to note that the color attribute itself does not directly control the background color.

3. The color picker is defined by it: The color picker is a visual interface that allows users to select a color. It is defined by the color attribute, which specifies the initial color displayed in the color picker. When a user interacts with the color picker, they can choose a different color, and the selected color value can be applied to the element's color attribute.

In conclusion, the color attribute in HTML is primarily used to change the color of the text within an element. While it can indirectly affect the background color, it does not directly control it. The color picker is defined by the color attribute, allowing users to select a desired color for an element.

Which attribute defines the file-select field?
  • a)
    file
  • b)
    checkbox
  • c)
    button
  • d)
    text
Correct answer is option 'A'. Can you explain this answer?

Manasa Ahuja answered
The file-select field is an attribute in HTML that allows users to select and upload files from their local device to a website or application. It is defined using the "file" attribute.

HTML Attributes
HTML attributes provide additional information about elements and define their behavior or appearance. The file-select field is just one of the many attributes that can be used in HTML to enhance user interactivity and functionality.

Using the file-select field
To create a file-select field in HTML, the "input" element is used with the type attribute set to "file". Here is an example of the HTML code for a file-select field:

```html

```

Key Points:
- The "input" element is a self-closing tag, meaning it does not require a closing tag.
- The "type" attribute specifies the type of input element, in this case, "file".
- The "name" attribute is used to identify the input element when it is submitted to the server.

Functionality of the file-select field
When a user clicks on a file-select field, a file selection dialog box is displayed by the browser. The user can then navigate through their local file system and select one or multiple files to upload. Once the user has made their selection, the selected file(s) can be accessed using server-side programming languages such as PHP or JavaScript.

Key Points:
- The file-select field does not actually upload the file to the server. It is only responsible for allowing the user to select the file(s) they want to upload.
- Additional HTML and server-side code is required to handle the file upload process and save the selected file(s) on the server.

Conclusion
The file-select field in HTML is a powerful attribute that enables users to select and upload files from their local device. It enhances the interactivity and functionality of a website or application by allowing users to provide files for further processing. By using the "input" element with the type attribute set to "file", developers can easily implement this feature and retrieve the selected file(s) for server-side processing.

Which of the following is not used with password attribute?
  • a)
    name
  • b)
    size
  • c)
    maxlength
  • d)
    min
Correct answer is option 'D'. Can you explain this answer?

Explanation:

The password attribute is used in HTML to create a text input field where the characters entered by the user are hidden from view. This is useful when users are required to enter sensitive information such as passwords or credit card numbers.

The following are some of the attributes that can be used with the password attribute in HTML:

a) Name: This attribute is used to specify a name for the input field. The name is used to identify the field when the form is submitted to the server.

Example:


b) Size: This attribute is used to control the width of the input field in characters. The size is specified as a number.

Example:


c) Maxlength: This attribute is used to specify the maximum number of characters that can be entered in the input field. The maxlength is specified as a number.

Example:


d) Min: This attribute is not used with the password attribute. The min attribute is used with input types such as number, date, and time to specify the minimum allowable value.

Therefore, the correct answer is option 'D' - Min.

Which parameter is commonly used for size attribute?
  • a)
    centimeter
  • b)
    pixels
  • c)
    inch
  • d)
    millimeter
Correct answer is option 'B'. Can you explain this answer?

Size Attribute and Its Common Parameter

The size attribute is used to define the width of an HTML element. It is commonly used for input elements such as text boxes, text areas, and buttons. The size attribute defines the number of visible characters that can be displayed within the element. The common parameter used for the size attribute is pixels.

Explanation

Pixels are the most common parameter used for the size attribute because they provide a precise and consistent measurement across different devices and screens. A pixel is a unit of measurement that represents a single point in a digital image. It is the smallest unit of measurement used on a screen.

When using the size attribute, the value is typically set in pixels. For example, if you want to create a text box that shows 20 characters, you would set the size attribute to 20 pixels. This ensures that the text box is wide enough to display 20 characters without wrapping the text to a new line.

Other Parameters

Although pixels are the most common parameter used for the size attribute, other parameters can also be used, including:

- Centimeter: This is a metric unit of measurement that is equal to one-hundredth of a meter. It is commonly used for print media.
- Inch: This is an imperial unit of measurement that is equal to 2.54 centimeters. It is commonly used for print media.
- Millimeter: This is a metric unit of measurement that is equal to one-thousandth of a meter. It is commonly used for print media.

Conclusion

In conclusion, the size attribute is commonly used to define the width of HTML elements, and the most common parameter used for this attribute is pixels. However, other parameters such as centimeters, inches, and millimeters can also be used depending on the medium used.

Which attribute is not for overriding the actions?
  • a)
    Formaction
  • b)
    Style
  • c)
    Tabindex
  • d)
    Slot
Correct answer is option 'D'. Can you explain this answer?

Anjali Gupta answered
formaction is used for overriding <form> action, style is a global attribute that overrides previously set styles, tabindex is also a global attribute which overrides default tab order. A slot is a global attribute which assigns a slot in a shadow.

What is the use of spellcheck attribute?
  • a)
    Checks spelling
  • b)
    Indicates if spell checking is allowed
  • c)
    Checks spelling and corrects it
  • d)
    Checks spelling of a given particular text only
Correct answer is option 'B'. Can you explain this answer?

Anjali Gupta answered
spellcheck is a global attribute, it indicates if spell checking is allowed or not for the element. Syntax is
<p contenteditable=”true” spellcheck=”true”> William Shakespeare was a great novelist. </p>

What is the default type of ‘type’ attribute of <input> element?
  • a)
    Text
  • b)
    Password
  • c)
    Numerals
  • d)
    Special Characters
Correct answer is option 'A'. Can you explain this answer?

Anjali Gupta answered
Text input type defines single line text field. Type is the attribute that displays type of <input> elements. Its default type is text. It is supported by most of the browsers like Chrome, Internet Explorer, Firefox, Opera. Syntax is: <form action=”jump.php”> Name:<input type=”text” name=”name”> </form> A password field is defined by password input.

datetime attribute is not related with ______________
  • a)
    <del>
  • b)
    <time>
  • c)
    <ins>
  • d)
    <form>
Correct answer is option 'D'. Can you explain this answer?

Anjali Gupta answered
datetime shows the date and time related with the element. Commonly use with <del>, <time>, <ins> elements. <del> is use with cite attribute, <ins> is also use with cite attribute, <form> element is use with various attributes like accept, action, accept-charset etc.

tel attribute is supported by the _________ browser.
  • a)
    Chrome
  • b)
    Safari
  • c)
    Opera
  • d)
    Internet Explorer
Correct answer is option 'B'. Can you explain this answer?

Rahul Verma answered
tel is the attribute which specifies field for telephone number. Syntax is <form action=”hkjk.php”> Telephone number: <input type=”tel” name=”usertelephone”> <br> <input type=”submit”> </form>, tel attribute is usually supported by newer versions like Safari 8.

Which of the following is a new input attribute introduce by HTML5?
  • a)
    text
  • b)
    checkbox controls
  • c)
    submit buttons
  • d)
    date
Correct answer is option 'D'. Can you explain this answer?

Rahul Verma answered
HTML4 has attributes with <input> elements like radio buttons, Checkbox controls, submit buttons, text input etc.
HTML5 has introduced new attributes like date, color, month, time, week, datetime-local, email, number, range, tel, url, search etc.

month attribute defines ___________
  • a)
    the only month
  • b)
    month and year
  • c)
    date
  • d)
    date and time
Correct answer is option 'B'. Can you explain this answer?

Rahul Verma answered
month and year are defined by month attribute. It does not define the time zone. The syntax is Anniversary (month and year) <input=”month” name=”anniversary month” >., date attribute defines the date, datetime-local defines date and time but no time zone.

Which of the following defines a default value on page load?
  • a)
    <object>
  • b)
    <input>
  • c)
    <progress>
  • d)
    <area>
Correct answer is option 'C'. Can you explain this answer?

Anjali Gupta answered
<button>, <li>, <progress>, <param>, <meter>, <input>, <option> are some elements used with value attribute and defines a default value on the page load. <object> element is used with many attributes like border, data, form, height etc. <area> is used with attributes like alt, cords, download, href, hreflang and many more.

Which attribute indicates a descending order of displaying a list?
  • a)
    reversed
  • b)
    forward
  • c)
    straight
  • d)
    circular
Correct answer is option 'A'. Can you explain this answer?

Rahul Verma answered
Reverse attribute commonly use with <ol> element. It indicates that if the list is to be displayed in descending order instead of ascending order or not. There is no reference for options like forward, straight and circular in HTML.

What does wrap attribute denote?
  • a)
    Whether the text is in bold
  • b)
    Whether the text is wrapped
  • c)
    Whether the text is in italics
  • d)
    Whether the text is highlighted
Correct answer is option 'B'. Can you explain this answer?

Rahul Verma answered
wrap is the attribute of <textarea> element and it indicates whether the text should be wrapped. Syntax: <textarea wrap=””> if we use wrap=”hard” it will contain newlines in the submission of a form. This attribute is newly introduced by HTML5 and is supported by all the browsers.

Chapter doubts & questions for HTML Forms - HTML for Junior Classes 2025 is part of Class 3 exam preparation. The chapters have been prepared according to the Class 3 exam syllabus. The Chapter doubts & questions, notes, tests & MCQs are made for Class 3 2025 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests here.

Chapter doubts & questions of HTML Forms - HTML for Junior Classes in English & Hindi are available as part of Class 3 exam. Download more important topics, notes, lectures and mock test series for Class 3 Exam by signing up for free.

HTML for Junior Classes

14 videos|31 docs|24 tests

Top Courses Class 3