Test Series - html

Test Number 25/72

Q: What is the default type of ‘type’ attribute of  element?
A. Text
B. Password
C. Numerals
D. Special Characters
Solution: Text input type defines single line text field. Type is the attribute that displays type of  elements. Its default type is text. It is supported by most of the browsers like Chrome, Internet Explorer, Firefox, Opera. Syntax is: 
Name:
A password field is defined by password input.
Q: Which of the following is a new input attribute introduce by HTML5?
A. text
B. checkbox controls
C. submit buttons
D. date
Solution: HTML4 has attributes with  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.
Q: 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
Solution: color is the attribute of  element introduce by HTML5. It defines the color picker i.e we can select a color of our choice from the color picker. Syntax is Select the color that you want: 
Q: Which attribute is used for activation of JavaScript?
A. button
B. checkbox
C. url
D. submit
Solution: Input type button is used for the activation of JavaScript on the clicking of the button. Its syntax is . This will display a button named click and when we click that button JavaScript function source() will be invoked.
Q: Which attribute defines the file-select field?
A. file
B. checkbox
C. button
D. text
Solution: file input type defines a file-select field, also gives a “Browse” button for file uploads. Syntax is . Checkbox gives the facility to select one or more than one options from the given choices. The button activates JavaScript code. The text defines a single-line text field.
Q: 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
Solution: the image input type set an image as submit button. The syntax is  this sets the image provided by url as the submit button. Input type image sends the X and Y coordinates of click and hence the image is activated by clicking the submit button.
Q: month attribute defines ___________
A. the only month
B. month and year
C. date
D. date and time
Solution: month and year are defined by month attribute. It does not define the time zone. The syntax is Anniversary (month and year) ., date attribute defines the date, datetime-local defines date and time but no time zone.
Q: week attribute defines ____________
A. week
B. year
C. week and year
D. week, month and year
Solution: week input type defines a week and year. It does not define the time zone. Syntax is 
week:
, this gives a selection box and display a calendar like chart from where we can select a week and the year as well.
Q: tel attribute is supported by the _________ browser.
A. Chrome
B. Safari
C. Opera
D. Internet Explorer
Solution: tel is the attribute which specifies field for telephone number. Syntax is 
Telephone number:
, tel attribute is usually supported by newer versions like Safari 8.
Q: Which attribute is not used on new forms?
A. size
B. text
C. name
D. maxlength
Solution: size attribute denotes the width of text input i.e measured by the number of characters inputted. E.g. If we input value 3 then it will create a box of width enough to display three characters. The user can enter more characters if they want. Syntax is 

You Have Score    /10