Webdesigning Interview Questions
Webdesigning Interview Questions
A. scripting
B. programming
C. styling
D. markup
Answer: D) markup
Explanation:
Explanation:
A. //
B. /* Comment */
C. // Comment //
D. <!-- Comment -->
Explanation:
You can add comments to your HTML source by using the following syntax,
A. Yes
B. No
Answer: A) Yes
Explanation:
Yes, the comments can be used to hide content. Here is the syntax,
A. Yes
B. No
Answer: A) YesExplanation:
Yes, the comments can be used to hide inline content. Here is the syntax,
A. <p>
B. <pre>
C. <panel>
D. None of the above
Answer: A) <p>
Explanation:
A. <HTML>
B. <HTMLbody>
C. <bdy>
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
D. <body>
Answer: D) <body>
Explanation:
8. Which tag contains the meta information about the HTML page?
A. <html>
B. <title>
C. <head>
D. <body>
Answer: C) <head>
Explanation:
The <head> tag contains the meta information about the HTML page.
A. <html>
B. <title>
C. <head>
D. <body>
Answer: A) <html>
Explanation:
A. Dave Raggett
B. Tim Berners-Lee
C. Denis Ritchie
D. All of the above
A. Special tags
B. Advanced tags
C. Empty tags
D. Other tags
Explanation:
HTML tags with no content are called empty tags. For example,
the <br> tag, <hr> tag.
A. Yes
B. No
Answer: A) Yes
Explanation:
A. Yes
B. No
Answer: B) No
Explanation:
A. <head1> to <head6>
B. <p1> to <p6>
C. <h1> to <h6>
D. <h1> to <h3>
Explanation:
A. <br>
B. <hr>
C. <hr>...</hr>
D. <line>
Answer: B) <hr>
Explanation:
A. <hr>
B. <hr />
C. <hr></hr>
D. All of the above
Explanation:
Both <hr> and <hr /> can be used to display a horizonal line.
Answer: C) <br>
Explanation:
A. <br>
B. <br />
C. <br></br>
D. All of the above
Explanation:
Both <br> and <br /> can be used to display a line break.
A. <pf>
B. <p>
C. <pre>
D. <code>
Answer: C) <pre>
Explanation:
The <pre> tag is used to define preformatted text. It is displays the text as it is –
keeps spaces & line breaks intact (Original state). Output text looks same as
inputted text.
A. <style>
B. <css>
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
C. style
D. css
Answer: C) style
Explanation:
21. Which is the correct HTML statement to define the red color of the
paragraph text?
Explanation:
22. Which HTML tag is used to define bold text, without any extra importance?
A. <strong>
B. <bold>
C. <bolder>
D. <b>
Answer: D) <b>
Explanation:
The HTML <b> tag is used to define bold text, without any extra importance.
23. Which HTML tag is used to define text with strong importance?
A. <strong>
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
B. <bold>
C. <bolder>
D. <b>
Answer: A) <strong>
Explanation:
The HTML tag <strong> is used to define text with strong importance.
A. <italic>
B. <em>
C. <i>
D. <it>
Answer: C) <i>
Explanation:
A. <italic>
B. <em>
C. <i>
D. <it>
Answer: B) <em>
Explanation:
A. <normal>
B. <span>
C. <smaller>
D. <small>
Explanation:
A. <mark>
B. <highlight>
C. <m>
D. <highlighted>
Answer: A) <mark>
Explanation:
28. Which HTML tag is used to define strike a line through deleted text?
A. <delete>
B. <del>
C. <deleted>
D. <through>
Answer: B) <del>
Explanation:
The HTML tag <del> is used to define strike a line through deleted text.
A. <underline>
B. <text-decoration>
C. <u>
D. <ins>
Answer: D) <ins>
Explanation:
A. <sub>
B. <subscript>
C. <s>
D. <subscripted>
Answer: A) <sub>
Explanation:
A. <sup>
B. <superscript >
C. <s>
D. <superscripted>
Answer: A) <sup>
Explanation:
A. <p>H<sup>2</sup>O</p>
B. <p>H<ins>2</ins>O</p>
C. <p>H<below>2</below>O</p>
D. <p>H<sub>2</sub>O</p>
Answer: D) <p>H<sub>2</sub>O</p>
Explanation:
A. <p>Hello<sup>World</sup></p>
B. <p>Hello<top>World</top></p>
C. <p>Hello<sub>World</sub></p>
D. <p>Hello<above>World</above></p>
Answer: A) <p>Hello<sup>World</sup></p>
Explanation:
A. <p><del>Hello</del><ins>Hi!</ins></p>
B. <p><strike>Hello</strike><ins>Hi!</ins></p>
C. <p><cut>Hello</cut><ins>Hi!</ins></p>
D. All of the above
Explanation:
35. Which is the correct HTML statement to display Hello World in a paragraph?
Explanation:
A. <quotation>
B. <quote>
C. <qut>
D. <q>
Answer: D) <q>
Explanation:
A. <abbreviation>
B. <abbr>
C. <acronym>
D. <acr>
Answer: B) <abbr>
Explanation:
The HTML <abbr> tag defines an abbreviation or an acronym, like "HTML", "CSS",
"Mr.", "Dr."
Explanation:
A. <contact>
B. <authorinfo>
C. <address>
D. <addr>
Answer: C) <address>
Explanation:
The HTML tag <address> is used to define the contact information for the
author/owner of a document or an article. The text in the <address> element usually
renders in italic, and browsers will always add a line break before and after
the <address> element.
A. <bdi>
B. <bdo>
C. <bdr>
D. None of the above
Answer: B) <bdo>
Explanation:
The HTML tag <bdo> is used to override the current text direction from right to left.
BDO stands for Bi-Directional Override.
Output:
A. <a>
B. <h>
C. <hyperlink>
D. Both A. and B.
Answer: A) <a>
Explanation:
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
The HTML <a> tag defines a hyperlink.
Explanation:
Explanation:
The href attribute of the <a> tag is most important, which indicates the link's
destination.
44. Which ____ attribute specifies where to open the linked document?
A. href
B. link
C. src
D. target
Answer: D) target
Explanation:
A. <img>
B. <pic>
C. <image>
D. <picture>
Answer: C) <img>
Explanation:
A. <img src="url">
B. <img src="url" alt="alternatetext">
C. <img src="url" alt="alternatetext" />
D. All of the above
Explanation:
<img src="url">
<!--Or-->
<img src="url" alt="alternatetext">
A. href
B. link
C. src
D. All of the above
Answer: C) src
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
Explanation:
A. alt
B. alternate
C. alttext
D. All of the above
Answer: B) alternate
Explanation:
A. <table>
B. <tables>
C. <tr>
D. <th>
Answer: A) <table>
Explanation:
Explanation:
Explanation:
Explanation:
Explanation:
The HTML tag <ol> ... </ol> is used to define ordered listing.
Explanation:
The HTML tag <ul> ... </ul> is used to define unordered listing.
Explanation:
The HTML tag <li> ... </li> is used to define list items.
Explanation:
The HTML tag <dl> ... </dl> is used to define description lists.
Explanation:
58. Which attribute is often used to point to a class name in a style sheet?
A. style
B. css
C. src
D. class
Answer: D) class
Explanation:
The class attribute is often used to point to a class name in a style sheet.
A. style
B. css
C. id
D. class
Answer: C) id
Explanation:
A. Yes
B. No
Answer: A) Yes
Explanation:
A. Yes
B. No
Answer: B) No
Explanation:
A. <frame>
B. <iframe>
C. <inlineframe>
D. <frames>
Answer: B) <iframe>
Explanation:
The HTML tag <iframe> specifies an inline frame. It is used to embed documents,
YouTube videos, google map, and interactive media with in a page.
Explanation:
A. <form>
B. <input>
C. <form_put>
D. <form_get>
Answer: A) <form>
Explanation:
The HTML tag <form> is used to create an HTML form for user input.
A. <input type="textbox">
B. <input type="checkbox">
C. <input type="text">
D. <input type="submit">
Explanation:
The HTML tag <input type="text"> is used to display a single-line input field.
A. <input type="textbox">
B. <input type="checkbox">
C. <input type="text">
D. <input type="radio">
Explanation:
A. <input type="textbox">
B. <input type="checkbox">
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
C. <input type="text">
D. <input type="radio">
Explanation:
A. <input type="submit">
B. <input type="checkbox">
C. <input type="text">
D. <input type="radio">
Explanation:
A. <input type="submit">
B. <input type="checkbox">
C. <input type="text">
D. <input type="button">
Explanation:
70. Which input type reset defines a reset button that will reset all form values
to their default values?
A. clear
B. clear:both
C. reset
D. refresh
Explanation:
The reset input type reset defines a reset button that will reset all form values to their
default values. Here is the syntax,
<input type="reset">
71. What are the different new form element types in HTML 5?
Answer: There are ten important new form elements introduced in HTML 5:
1. Color
2. Date
3. Datetime-local
4. Email
5. Time
6. URL
7. Range
8. Telephone
9. Number
[Link]
Let’s understand these elements step-by-step.
If you want to show a color picker dialog box (See Figure 9.4).
If you want to show a calendar with local time (See Figure 9.6).
If you want to create an HTML text with e-mail validation we can set the type as
“email”.
For URL validation set the type as “url” as shown in the Figure 9.8 in which HTML
code is given.
For URL validation set the type as “url” as shown in the below HTML code.
If you want to display textbox with number range you can set type to number (See
Figure 9.9).
If you want to display a range control you can use type as range as shown in code
given below (see Figure 9.10)
Answer: It is written at the top of html document. It’s Not HTML tag. <!DOCTYPE>
tells the browser about the HTML version. It is an "information" to the browser about
what document type to expect.
Answer: Almost all browsers, i.e., Safari, Chrome, Firefox, Opera, Internet Explorer,
support HTML 5.
Answer: metadata is information about the data. It is write in <head> section using
<meta> tag. This information not displayed anywhere to users. It consists of
elements related to page description, keywords. Meta information used by search
engines.
Answer: Span tag is used for grouping and applying styles to inline elements by
using the class or id attributes.
Answer: <span> tag is similar to <div> tag. Span is inline tag is and div is a block-
level tag. Span tag is used to designed inline content like (adding colors, background
color, and highlighting text) by using the class or id attributes. Nested span tags will
not be used for HTML documents.
HTML <div> tag: The div tag is known as Division tag. The div tag is used in
HTML to make divisions of content on the web page like (text, images, header,
footer, navigation bar, etc). Nested <div> tag is used for HTML documents with
different styles.
Answer: Inline elements take as much width as required E.g. <a>, <img>,
<span>,<b>,<strong>,<input> Block level elements consume the full width available
& starts from new line E.g. <h1>, <p>, <div>,<form>,<nav>
Answer:
Viewport is visible area of web page on a browser. Its changes based on the
device size (Smaller on mobile phone and larger on computer screen)
Before tablets and mobile phones, web pages were designed only for
computer screens, and it was common for web pages to have a static design
and a fixed size.
HTML5 introduced a method to let web designers take control over the
viewport, through the <meta> tag.
This gives the browser instructions on how to control the page's dimensions
and scaling.
The width=device-width part sets the width of the page to follow the screen-
width of the device (which will vary depending on the device).
The initial-scale=1.0 part sets the initial zoom level when the page is first
loaded by the browser.
Syntax:
Answer: Visibility hidden simply hides the element but the space is allocated for it
on the page which not visible on the page. In case of Display: none it also hides the
element and no space allocated for it on the page. Page appears as if no element is
present.
Answer: Cell Spacing is amount of space or gap between the two cells of same
table while Cell Padding is space or gap between the content inside the cell and its
borders.
Answer: We can change inline element into block level element by changing the
display property as display: block.
e.g. a {
display : block;
}
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
83. How to create a nested webpage in HTML?
Answer: The HTML iframe tag is used to display a nested webpage. In other words,
it represents a webpage within a webpage. In iframe tag we can give source or url of
another webpage by giving height and width.
Answer: No. Hyperlinks can be used both on texts and images. The HTML anchor
tag defines a hyperlink that links one page to another page.
A. Here,
B. rel defined the relationship.
C. href is the CSS filename.
D. type is the type of the file, for CSS – the type is "text/css"
5. In a CSS file, there is a CSS rule for paragraphs tags – what does p can be
called?
A. Selector
B. Attribute
C. Property
D. Tag
Answer: A) Selector
Explanation:
In a CSS rule, the HTML element(s) for them we are writing the CSS is known as
"CSS Selector".
OR
/*
This is
a multi-line
comment
*/
12. From the given options which is/are the valid way to represent a color?
A. A valid color name like "blue"
B. HEX code like "#0000ff"
C. RGB Value like "rgb(0,0,255)
D. All of the above
Answer: D) All of the above
Explanation:
All of the given options are valid to define/represent the color name.
13. Which property is used to define the font of the element's text?
A. font
B. font-family
C. font-style
D. All of the above
Answer: B) font-family
Explanation:
The font-family property is used to define the font of the element's text.
Example:
p
{
18. Which is the correct inline CSS for p tag to define paragraph's text and
background colors?
A. <p css="color: red; background-color: yellow;">
B. <p cssstyle="color: red; background-color: yellow;">
C. <p inline="color: red; background-color: yellow;">
D. <p style="color: red; background-color: yellow;">
Answer: D) <p style="color: red; background-color: yellow;">
Explanation:
The correct inline CSS style is,
<p style="color: red; background-color: yellow;">Paragraph Text.</p>
Example:
<p style="border: 2px solid red;">
This is some text in a paragraph.
</p>
20. Which of the following is the correct syntax to display the hyperlinks
without any underline?
A. a {text-decoration : underline;}
B. a {text-decoration : none;}
C. a {text-decoration : block;}
D. None of the above
Answer: B) a {text-decoration : none;}
Explanation:
The correct syntax to display the hyperlinks without any underline is,
a {text-decoration : none;}
21. Which of the following is the correct syntax to remove the underline on
hyperlinks and visited hyperlinks?
Explanation:
The correct syntax to display the hyperlinks without any underline is,
A. a:mouseover
B. a:move
C. a:mover
D. a:hover
Answer: D) a:hover
Explanation:
The a:hover property is used to define the style on mouse over event,
a:hover{
// styles
}
23. If you want to use a green dotted border around an image, which CSS
property is used for that?
A. border-style
B. border-color
C. border-decoration
D. Both A. and B.
Explanation:
Two properties border-style and border-color are used to define a green dotted
border around an image.
Example:
A. text-align:center
B. align:center
C. text-align:middle
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
D. align:middle
Answer: A) text-align:center
Explanation:
Explanation:
left
center
right
justify
Answer: A) Stretches the lines so that each line has equal width
Explanation:
The text-align:justify property stretches the lines so that each line has equal width.
27. Which CSS property is used to specify the indentation of the first line of a
text?
A. text-align
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
B. padding-left
C. margin-left
D. text-indent
Answer: D) text-indent
Explanation:
The text-indent property is used to specify the indentation of the first line of a text.
Example:
p{
text-indent: 50px;
}
28. Which CSS property is used to specify the space between the characters in
a text?
A. text-space
B. letter-space
C. letter-spacing
D. letter-distance
Answer: C) letter-spacing
Explanation:
The letter-spacing property is used to specify the space between the characters in a
text.
Example:
p{
letter-spacing: 5px;
}
29. Which CSS property is used to specify the space between lines?
A. line-space
B. line-spacing
C. line-padding
D. line-height
Explanation:
Example:
p{
line-height: 2.0;
}
30. Which CSS property is used to specify the space between the words in a
text?
A. word-spacing
B. word-padding
C. word-height
D. characters-spacing
Answer: A) word-spacing
Explanation:
The word-spacing property is used to specify the space between the words in a text.
Example:
p{
word-spacing: 10px;
}
A. content-shadow
B. text-shadow
C. word-shadow
D. text-outline
Answer: B) text-shadow
Explanation:
p{
text-shadow: 1px 2px green;
}
32. Which CSS property is used to specify uppercase and lowercase letters in
a text?
A. text-transform
B. text-case
C. case
D. text-casing
Answer: A) text-transform
Explanation:
Example:
p{
text-transform: uppercase / lowercase / capitalize;
}
33. Which is the correct CSS statement to capitalize the first letter of each
word?
A. text-transform: uppercase
B. text-transform: capitalize
C. text-transform: sentence
D. Both A. and B.
Explanation:
The correct CSS statement is to capitalize the first letter of each word,
p{
text-transform: capitalize;
Explanation:
uppercase
lowercase, and
capitalize
Explanation:
overline
line-through
underline, and
none
36. Which CSS property specifies how to align the last line of a text?
A. text-align
B. last-text-align
C. text-align-last-line
Answer: D) text-align-last
Explanation:
The text-align-last property specifies how to align the last line of a text.
Example:
p{
text-align-last: right;
}
A. vertical-align
B. vertical-text-align
C. text-valign
D. vertical-align-text
Answer: A) vertical-align
Explanation:
Example:
p{
vertical-align: baseline;
}
Explanation:
baseline
text-top
text-bottom
sub, and
super
39. Which is the correct CSS statement to define multiple font families?
Explanation:
p{
font-family: "Times New Roman", Times, serif;
}
40. Which CSS property specifies the type of list item marker?
A. list-style
B. list-style-type
C. list-style-circle
D. list-style-square
Answer: B) list-style-type
Explanation:
Example:
ul {
list-style-type: circle;
}
A. list-style: none;
B. list-style-type: 0;
C. list-style-type: blank;
D. list-style-type: none;
Explanation:
ul {
list-style-type: none;
}
42. Which CSS property specifies an image as the list item marker?
A. list-style-image
B. list-style-picture
C. list-style-background
D. list-style-bgimage
Answer: A) list-style-image
Explanation:
Example:
ul {
list-style-image: url('[Link]');
}
A. block
B. display
C. element-display
D. element-block
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
Answer: B) display
Explanation:
Example:
ul {
display: block;
}
44. Which CSS property specifies the type of positioning method used for an
element?
A. positions
B. text-position
C. positioning
D. position
Answer: D) position
Explanation:
The position property specifies the type of positioning method used for an element.
Example:
[Link]{
position: fixed;
}
A. static
B. fixed
C. relative
D. none
Answer: A) static
Explanation:
Explanation:
static
relative
fixed
absolute
sticky
A. transparency
B. opacity
C. transform-opacity
D. opacity-all
Answer: B) opacity
Explanation:
Example:
img {
opacity: 0.8;
}
A. sum()
B. add()
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
C. calc()
D. addition()
Answer: C) calc()
Explanation:
Example:
body {
width: calc(100% - 100px);
}
A. large()
B. maximum()
C. max_value()
D. max()
Answer: D) max()
Explanation:
Example:
body {
width: max(80%, 100px);
}
A. small()
B. minimum()
C. min_value()
D. min()
Answer: D) min()
Explanation:
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
The min() function uses the smallest value.
Example:
body {
width: min(80%, 100px);
}
A. border-corner
B. radius
C. corner
D. border-radius
Answer: D) border-radius
Explanation:
Example:
.div1{
border-radius: 25px;
}
A. border-image
B. border-picture
C. border-background
D. border-bgimage
Answer: A) border-image
Explanation:
The border-image property allows you to specify an image to be used instead of the
normal border around an element.
.borderedimage{
border-image: url([Link]) 30 round;
}
Answer: C) RGBA color values are an extension of RGB color values with an alpha
channel
Explanation:
RGBA color values are an extension of RGB color values with an alpha channel.
Explanation:
RGBA color values are an extension of RGB color values with an alpha channel -
which specifies the opacity for a color.
Example:
rgba(255, 0, 0, 0.2);
Explanation:
The RGBA value (rgba(255, 0, 0, 0.3)) specifies the color with opacity.
Explanation:
The CSS statement (background-color: rgba(0, 0, 255, 0.3)) specifies the blue
background with an opacity.
Explanation:
Hue is a degree on the color wheel from 0 to 360. 0 is red, 120 is green, 240
is blue.
Explanation:
Explanation:
Explanation:
An HSLA color value is specified with: hsla(hue, saturation, lightness, alpha), where
the alpha parameter defines the opacity.
A. 0 to 255
B. 0 to 90
C. 0 to 16
D. 0.1 to 1.0
Explanation:
12. Which is the correct HSLA value for green color with fully transparent?
Explanation:
13. Which CSS property sets the opacity for the whole element?
A. aplha
B. opacity-value
C. opacity
D. background-opacity
Answer: C) opacity
Explanation:
The opacity property sets the opacity for the whole element.
Example:
p
{
opacity:0.4;
}
A. transparent
B. opacity
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
C. color-transparent
D. alpha
Answer: A) transparent
Explanation:
The transparent keyword is used to make a color transparent. It is mostly used for
creating the transparent background color of an element.
Example:
body {
background-image: url("[Link]");
}
div.example1 {
background-color: transparent;
}
A. rgba(0,0,0,0)
B. rgba(0,0,0,1)
C. rgba(255,255,255,0)
D. rgba(255,255,255,1)
Answer: A) rgba(0,0,0,0)
15) What is the role of the media objects in Bootstrap and how many types are
available?
In Bootstrap, it is possible to add images, audio, and video using media object. It can
either be placed on the left side or the right side of the content. If the developer
wishes to create a media element then they can use .media a class where the
source will be specified as a .media-object class. There are usually two types of
Media-objects i.e. .media and .media-list.
Easy to get started − With just the knowledge of HTML and CSS anyone can get
started with Bootstrap. Also the Bootstrap official site has a good documentation.
Responsive design − Bootstrap's responsive CSS adjusts to Desktops,Tablets and
Mobiles.
Provides a clean and uniform solution for building an interface for developers.
It contains beautiful and functional built-in components which are easy to customize.
It also provides web based customization.
And best of all it is an open source
Q2. Which of the following class applies the hover color to a particular row or
cell of a table?
A - .active
B - .success
C - .warning
D - .danger
Answer: .active
Answer: 24px
Answer: Phones
Answer: Desktop
Q13. Which Of The Following Contextual Class Is Used For Warning Purpose?
A. .active
B. .warning
C. .danger
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
D. All Of The Above
Answer: .warning
Answer: Carousel
Answer: .container
Answer: List-group
Answer: 12 column
Answer: True
A. Desktop
B. Mobile
C. Web
D. Server
Answer: C) Web
Explanation:
A. Object-oriented
B. Object-based
C. Functional programming
D. All of the above
Answer: B) Object-based
Explanation:
Explanation:
A. <javascript>...</javascript>
B. <js>...</js>
C. <script>...</script>
D. <css>...</css>
Answer: C) <script>...</script>
Explanation:
Explanation:
JavaScript code can be written in the JavaScript file and in HTML document directly.
A. Comma (,)
B. Colon (:)
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
C. Hyphen (_)
D. Semicolon (;)
Explanation:
7. JavaScript ignores?
A. newlines
B. tabs
C. spaces
D. All of the above
Explanation:
JavaScript ignores spaces, tabs, and newlines written in the code, we can use them
for the alignment and separate the sections to give a perfect look at our code.
8. Which is the correct syntax to call an external JavaScript file in the current
HTML document?
A. <script src="[Link]"></script>
B. <script href=" [Link]"></script>
C. <import src=" [Link]"></import>
D. <script link=" [Link]"></script>
Explanation:
The correct syntax to call an external JavaScript file in the current HTML document
is:
<script src="[Link]"></script>
A. getElementById()
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
B. getElement(id)
C. getElementById(id)
D. elementById(id)
Answer: C) getElementById(id)
Explanation:
10. Which property is used to define the HTML content to an HTML element
with a specific id?
A. innerText
B. innerContent
C. elementText
D. innerHTML
Answer: D) innerHTML
Explanation:
Example:
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: A) [Link]()
Explanation:
Answer: C) [Link]()
Explanation:
A. [Link]()
B. [Link]()
C. [Link]()
D. [Link]()
Answer: B) [Link]()
Explanation:
14. Which is the correct JavaScript statement to display "Hello Boss!" into an
alert box?
A. alert("Hello Boss!");
B. alert('Hello Boss!');
C. alert(Text:'Hello Boss!');
D. Both A. and B.
Explanation:
The both of statement are correct to display "Hello Boss!" into an alert box:
[Link]("Hello Boss!");
[Link]('Hello Boss!');
15. Which is the correct JavaScript statement to print the addition of two
numbers 10 and 20 in a paragraph whose id is "result"?
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
A. getElementById("result").innerHTML = 10+20;
B. getElementById("result").innerHTML = "10+20";
C. getElementById("#result").innerHTML = 10+20;
D. All of the above
Explanation:
The correct JavaScript statement to print the addition of two numbers 10 and 20 in a
paragraph whose id is "result" is:
[Link]("result").innerHTML = 10+20;
<button onclick="[Link]()">Submit</button>
Explanation:
A. #
B. /*
C. $
D. //
Answer: D) //
Explanation:
A. /* and */
B. <!—and -->
C. ## and ##
D. // and //
Answer: A) /* and */
Explanation:
A. Var
B. var
C. Let
D. All of the above
Answer: B) var
Explanation:
A. 1
B. 2
C. 3
D. 4
Answer: C) 3
Explanation:
var
let
const
Answer: B) var defined function scoped variable while let define block scoped
variable
Explanation:
The var and let keywords are both used for variable declaration in JavaScript. But,
the main difference between them is that var defines function scoped variable
while let defines block-scoped variable.
Answer: C) Constant
Explanation:
A. const constant_name;
B. constant_name const;
C. constant_name const = value;
D. const constant_name = value;
Explanation:
const PI = 3.14;
<script>
const VALUE = 10;
VALUE = 20;
</script>
A. 10
B. 20
C. ValueError
D. TypeError
Answer: D) TypeError
Explanation:
We cannot change the value of a constant, thus the above code will generate a
TypeError – "TypeError: Assignment to constant variable"
A. 0
B. undefined
C. null
D. NaN
Answer: B) undefined
Explanation:
<script>
var a;
[Link]("demo").innerHTML = a+1;
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
</script>
A. 0
B. undefined
C. 1
D. NaN
Answer: D) NaN
Explanation:
A. Yes
B. No
Answer: A) Yes
Explanation:
<script>
var name = "Fortune" + " " + "Cloud";
[Link]("demo").innerHTML = name;
</script>
A. Fortune Cloud
B. FortuneCloud
C. TypeError
D. ValueError
Explanation:
<script>
var a = 10 + 20 + "5";
[Link]("demo").innerHTML = a;
</script>
A. 35
B. 305
C. TypeError
D. ValueError
Answer: B) 305
Explanation:
A. Yes
B. No
Answer: B) No
Explanation:
<script>
let a = 10;
let a = 0;
</script>
A. 10
B. 0
C. SyntaxError
D. TypeError
Answer: C) SyntaxError
The output of the above JavaScript code is: "SyntaxError: 'a' has already been
declared".
A. exp()
B. ^
C. **
D. pow
Answer: C) **
Explanation:
33. Does JavaScript support increment (++) and decrements (--) Operators?
A. Yes
B. No
Answer: A) Yes
Explanation:
Example:
<script>
var x = 5;
[Link]("test").innerHTML = ++x;
</script>
<script>
var x = 5;
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
[Link]("demo").innerHTML = x--;
</script>
A. 5
B. 4
C. TypeError
D. ValueError
Answer: B) 4
Explanation:
<script>
var x = 10 + 20 * 5;
[Link]("tes").innerHTML = x;
</script>
A. 110
B. 150
C. TypeError
D. ValueError
Answer: A) 110
Explanation:
<script>
var x = (10 + 20) * 5;
[Link]("tes").innerHTML = x;
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
</script>
A. 110
B. 150
C. TypeError
D. ValueError
Answer: B) 150
Explanation:
In the above code, the expression is (10 + 20) * 5. The precedence of () are higher
than any other operators This (10 + 20) will evaluate first.
A. Static
B. Dynamic
Answer: B) Dynamic
Explanation:
JavaScript types are dynamic, which means the same variable can be used to store
the different types of values.
A. round brackets ()
B. curly brackets {}
C. double quotes ""
D. square brackets []
Explanation:
Explanation:
A. typeof
B. TypeOf
C. typeOf
D. sizeof
Answer: A) typeof
Explanation:
A. typeof variable/value
B. typeof(variable/value)
C. Both A. and B.
D. None of the above
Explanation:
<script>
var x = 12.34;
[Link]("test").innerHTML = typeof(x);
A. int
B. float
C. long
D. number
Answer: D) number
Explanation:
A. module
B. fun
C. func
D. function
Answer: D) function
Explanation:
Explanation:
<script>
function addition(a, b) {
return a+b;
}
[Link]("test").innerHTML = addition;
</script>
A. SyntaxError
B. ValueError
C. 0
D. function addition(a, b) { return a+b; }
Explanation:
Calling of a function without () will return the function definition i.e., function object
instead of the result.
A. Yes
B. No
Answer: A) Yes
Explanation:
47. In JavaScript a variable contains one value while an object may contain
___.
A. One value
B. Two values
C. Three values
Explanation:
In JavaScript a variable contains one value while an object may contain many
values.
A. objectName:propertyName
B. propertyName
C. objectName["propertyName"]
D. Both B. and C.
Explanation:
A. strlen
B. len
C. length
D. Length
Answer: C) length
Explanation:
<script>
let str = "FortuneCloud";
[Link]("test").innerHTML = [Link];
</script>
Answer: A) 11
Explanation:
The output of the above statement will be the length of the string. That is 11.
51. Which character is used to break up a code line within a text string in
JavaScript?
Explanation:
The Single backslash (\) is used to break up a code line within a text string in
JavaScript.
Example:
[Link]("test").innerHTML = "Hello \
FortuneCloud!";
<script>
[Link]("test").innerHTML = \
"Hello, FortuneCloud!";
</script>
A. Yes
B. No
Answer: B) No
Explanation:
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
No, the above code will not work. Because, we cannot breakup a JavaScript code
line with single backslash (\).
Explanation:
The strings can also be defined as an object using the new keyword. The correct
JavaScript statement to define a string as an object is:
<script>
let str1 = new String("FortuneCloud!");
let str2 = new String("FortuneCloud!");
[Link]("test").innerHTML = (str1==str2);
</script>
A. true
B. false
C. True
D. False
Answer: B) false
Explanation:
In the above code, str1 and str2 are the objects. And. In the JavaScript, comparison
of two objects returns false.
A. 10 , 10
B. 10 , undefined
C. 10 , [object Undefined]
D. None of the above
Explanation:
In the above JavaScript code, the statement toString(x) will not convert number to
string because toString() is not a global method, it is a Number method and the
correct way is to call this function is [Link]().
<script>
let x = 10;
A. number , string
B. number , number
C. object , string
D. object , object
Explanation:
In the above JavaScript code, we are using the String() method which is a global
method to convert numbers to string. Thus, the statement typeof String(x) will
return string.
Explanation:
In JavaScript, the string template literals use back-ticks (``) rather than the quotes
("") to define a string.
A. Yes
B. No
Answer: A) Yes
Explanation:
The JavaScript variable definition statement is true. Because, with the JavaScript
template literals, we can use both single and double quotes inside a string.
A. toString()
B. intToString()
C. parseInteger()
D. All of the above
Answer: A) toString()
Explanation:
A. he
B. undefinedh
C. ValueError
D. TypeError
Answer: A) he
Explanation:
In JavaScript, the array indexing starts with 0. Thus, the above statement with print
"h" and "e".
<script>
let cars = ['Honda', 'Hyundai'];
[Link]('Mahindra');
[Link](typeof cars + " " + cars);
</script>
A. array Honda,Hyundai,Mahindra
B. string Honda,Hyundai,Mahindra
C. object Honda,Hyundai,Mahindra
D. object "Honda", "Hyundai", "Mahindra"
Explanation:
The push() method pushes an element at the end of the array. And, typeof returns
the type of the object. Here, cars is an array.
<script>
let cars1 = ['Honda', 'Hyundai'];
let cars2 = cars1;
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
[Link]('Mahinda');
A. Honda,Hyundai,Mahinda---Honda,Hyundai
B. Honda,Hyundai,Mahinda---Honda,Hyundai,Mahinda
C. Honda,Hyundai ---Honda,Hyundai
D. [Honda,Hyundai,Mahinda]---[Honda,Hyundai,Mahinda]
Answer: B) Honda,Hyundai,Mahinda---Honda,Hyundai,Mahinda
Explanation:
In the JavaScript, the arrays are objects, and the array elements are stored by
reference. Hence, when an array value is copied, any change in the copied array will
also reflect in the original array. Thus, the values of cars1 and cars2 are the same.
<script>
var msgs=new Array("Hello","Hey","Morning!");
for (i=0;i<[Link];i++){
[Link](msgs[i] + " | ");
}
</script>
Explanation:
In the above JavaScript code, the array is declared using the new operator and all
elements are printing using the loop. Thus, the output would be "Hello | Hey |
Morning! |".
A. Result: 40
B. Result: 70
C. Result: 90
D. Result: 100
Explanation:
In the above JavaScript code, we used the reduceRight() method which is used to
reduce the given array elements into a single value by executing a reducer function.
The reducer() function is applied against the accumulator and reduces all the
elements from right to left. Thus, the output would be "Result: 100".
<script>
var cars = ["Honda","Hyundai","Mahindra"];
A. Result: Honda,Hyundai,Mahindra
B. Result: Honda
C. Result: Hyundai,Mahindra
D. Result: Honda,Mahindra
Explanation:
In the above JavaScript code, we used the shift() method which is used to remove
the first element of the given array and return that element. This method changes
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
the length of the original array. Thus, the output would be "Result:
Hyundai,Mahindra".
<script>
var cars = ["Honda","Hyundai","Mahindra"];
A. [5] Toyota,Tata,Honda,Hyundai,Mahindra
B. [5]Honda,Hyundai,Mahindra,Toyota,Tata
C. [2] Toyota,Tata
D. [5] Honda,Hyundai,Toyota,Tata,Mahindra
Explanation:
In the above JavaScript code, we used unshift() method which is used to add one or
more elements in the beginning of the given array and returns the updated array.
This method changes the length of the original array. Thus, the output would be "[5]
Toyota,Tata,Honda,Hyundai,Mahindra".
A. for()
B. traverse()
C. forEach()
D. foreach()
Answer: C) forEach()
Explanation:
The JavaScript method forEach() is used to call a function (a callback function) once
for each array element.
<script>
let x = "10";
let y = + x;
[Link](typeof y);
</script>
A. string
B. object
C. undefined
D. number
Answer: D) number
Explanation:
jQuery
1. jQuery is a ______.
A. JavaScript Library
B. JSON Library
C. Java Library
D. JSON and CSS Library
Explanation:
2. To work with jQuery, you should have the basic knowledge of these topics?
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
A. HTML
B. CSS
C. JavaScript
D. All of the above
Explanation:
To work with jQuery, you should have the basic knowledge of HTML, CSS, and
JavaScript.
A. John Richard
B. John Resig
C. John Carter
D. John Alexander
Explanation:
A. 2004
B. 2005
C. 2006
D. 2007
Answer: C) 2006
Explanation:
5. Is jQuery case-sensitive?
A. Yes
B. No
Explanation:
A. HTML/DOM manipulation
B. CSS manipulation
C. HTML event methods
D. Effects and animations
E. AJAX
F. Utilities
G. All of the above
Explanation:
A. $
B. .
C. &
D. #
Answer: A) $
Explanation:
A. $(this).hideelement()
B. $(this).hide('true')
C. $(this).hide(0)
D. $(this).hide()
Answer: D) $(this).hide()
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
Explanation:
A. $("div").hide()
B. $(div).hide()
C. $(".div").hide()
D. $("#div").hide()
Answer: A) $("div").hide()
Explanation:
10. Which is the correct jQuery statement to hide all elements having class
name "new"?
A. $("new").hide()
B. $(new).hide()
C. $(".new").hide()
D. $("#new").hide()
Answer: C) $(".new").hide()
Explanation:
The $(".new").hide() statement can be used to hide all elements having class name
"new".
11. Which is the correct jQuery statement to hide all elements having id name
"new"?
A. $("new").hide()
B. $(new).hide()
C. $(".new").hide()
D. $("#new").hide()
Answer: D) $("#new").hide()
Explanation:
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
The $("#new").hide() statement can be used to hide all elements having id name
"new".
Answer: A) jQuery selectors are used to select and manipulate HTML element(s)
Explanation:
13. Which is the correct jQuery selector statement to select all <div>
elements?
A. $(".div")
B. $("#div")
C. $("div")
D. $("<div>")
Answer: C) $("div")
Explanation:
The statement $("div") is the correct syntax to select all <div> elements.
A. $class
B. .class
C. #class
D. None
Answer: C) .class
Explanation:
The dot sign (.) i.e., .class is used for the class selector.
A. $id
B. .id
C. #id
D. None
Answer: C) #id
Explanation:
The hash sign (#) i.e., #id is used for the id selector.
Explanation:
The #id selectors are used to select all elements having the id.
A. $("all")
B. $("*.*")
C. $("*")
D. $("***")
Answer: C) $("*")
Explanation:
18. Which is the correct jQuery selector to select current HTML element?
Answer: A) $(this)
Explanation:
19. Which is the correct jQuery selector to select all <div> elements with class
name "new"?
A. $(".new")
B. $("[Link]")
C. $(".[Link]")
D. $(".div#new")
Answer: B) $("[Link]")
Explanation:
The $("[Link]") selector is used to select all <div> elements with class name "new".
A. click()
B. Click()
C. dblclick()
D. DblClick()
Answer: A) click()
Explanation:
The jQuery method click() is used to attach an event handler function to an HTML
element on mouse click.
Answer: C) dblclick()
Explanation:
The jQuery method dblclick() is used to attach an event handler function to an HTML
element on mouse double click.
A. mouseover()
B. mousevisit()
C. mouse-enter()
D. mouseenter()
Answer: D) mouseenter()
Explanation:
A. mouseLeave()
B. mouseleave()
C. mouse-leave()
D. mouseexit()
Answer: B) mouseleave()
Explanation:
A. mousedown()
B. mouseover()
C. mousepress()
D. mousekey()
Answer: A) mousedown()
Explanation:
A. mouseup()
B. mouseover()
C. mouseabove()
D. mousekey()
Answer: A) mouseup()
Explanation:
A. mousemove()
B. mouseover()
C. hover()
D. mousehover()
Answer: C) hover()
Explanation:
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
The jQuery method hover() is used to attach an event handler function to an HTML
element when the mouse moves over the HTML elements.
A. focused()
B. focuses()
C. focuselement()
D. focus()
Answer: D) focus()
Explanation:
The jQuery method focus() is used to attach an event handler function to an HTML
element when the form field gets focus.
A. blur()
B. leave()
C. focusleave()
D. leavefocus()
Answer: A) blur()
Explanation:
The jQuery method blur() is used to attach an event handler function to an HTML
element when the form field loses focus.
Explanation:
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
The toggle() method is used to hide the shown elements and to show the hidden
elements.
A. fade()
B. fadeIn()
C. fadeOut()
D. fadeToggle()
Answer: B) fadeIn()
Explanation:
A. $(selector).fadeIn();
B. $(selector).fadeIn(callback, speed);
C. $(selector).fadeIn(callback);
D. $(selector).fadeIn(speed,callback);
Answer: D) $(selector).fadeIn(speed,callback);
Explanation:
$(selector).fadeIn(speed,callback);
A. fadeout()
B. fadeIn()
C. fadeOut()
D. fadeToggle()
Answer: C) fadeOut()
Explanation:
A. $(selector).fadeOut();
B. $(selector).fadeOut(callback, speed);
C. $(selector).fadeOut(callback);
D. $(selector).fadeOut(speed,callback);
Answer: D) $(selector).fadeOut(speed,callback);
Explanation:
$(selector).fadeOut(speed,callback);
34. Which jQuery method toggles between the fadeIn() and fadeOut()
methods?
A. toggle()
B. Toggle()
C. fadeToggle()
D. fadetoggle()
Answer: C) fadeToggle()
Explanation:
A. $(selector).fadeToggle();
B. $(selector).fadeToggle(callback, speed);
C. $(selector).fadeToggle(callback);
D. $(selector).fadeToggle(speed,callback);
Answer: D) $(selector).fadeToggle(speed,callback);
Explanation:
36. Which jQuery method allows fading to a given opacity (value between 0
and 1)?
A. fade()
B. fadeOpacity()
C. fadeTo()
D. fadeto()
Answer: C) fadeTo()
Explanation:
The jQuery fadeTo() method allows fading to a given opacity (value between 0 and
1).
37. Which is the correct jQuery statement to fade out a <p> element?
A. $("p").fadeOut();
B. $("#p").fadeOut();
C. $(".p").fadeOut();
D. $("p").fadeout();
Answer: A) $("p").fadeOut();
Explanation:
$("p").fadeOut();
38. Which is the correct jQuery statement to fade out a <p> element with
duration effect "slow"?
A. $("p").fadeOut("slow");
B. $("#p").fadeOut("slow");
C. $(".p").fadeOut("slow");
D. $("p").fadeout();
Answer: A) $("p").fadeOut("slow");
The jQuery statement to fade out a <p> elements with duration effect "slow" is:
$("p").fadeOut("slow");
A. slideBottom()
B. slideDown()
C. slidedown()
D. slide()
Answer: B) slideDown()
Explanation:
A. slideUp()
B. slideBottom()
C. slidebottom()
D. slide()
Answer: A) slideUp()
Explanation:
41. Which jQuery method toggles between the slideDown() and slideUp()
methods?
A. slide ()
B. slideSwitch()
C. slidetoggle()
D. slideToggle()
Answer: D) slideToggle()
Explanation:
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
The jQuery slideToggle() method toggles between
the slideDown() and slideUp() methods.
A. animation()
B. slidAnimate()
C. animate()
D. SlideAnimate()
Answer: C) animate()
Explanation:
A. $(selector).animate({params},speed,callback);
B. $(#selector).animate({params},speed,callback);
C. $(selector).animate(speed,callback);
D. $(selector).animate({speed,callback,params});
Answer: A) $(selector).animate({params},speed,callback);
Explanation:
$(selector).animate({params},speed,callback);
Explanation:
45. In the syntax of animate() method, what is/are the valid value(s) of speed
parameter?
A. slow
B. fast
C. milliseconds
D. All of the above
Explanation:
The following are the correct value of the speed parameter are:
slow
fast
milliseconds
A. animate(false)
B. animate('false')
C. animate("false")
D. stop()
Answer: D) stop()
Explanation:
Explanation:
48. Which jQuery DOM method is used to set or return the text content of
selected elements?
A. content()
B. text()
C. html()
D. val()
Answer: B) text()
Explanation:
The jQuery DOM method text() is used to set or return the text content of selected
elements.
49. Which jQuery DOM method is used to set or return the content of selected
elements (including HTML markup)?
A. content()
B. text()
C. html()
D. val()
Answer: C) html()
Explanation:
The jQuery DOM method html() is used to set or return the content of selected
elements (including HTML markup).
50. Which jQuery DOM method is used to set or return the value of form
fields?
A. content()
B. text()
C. html()
D. val()
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
Answer: D) val()
Explanation:
The jQuery DOM method val() is used to set or return the value of form fields.
51. Which jQuery DOM method is used to insert content at the end of the
selected elements?
A. insert()
B. add()
C. append()
D. appendValue()
Answer: C) append()
Explanation:
The jQuery DOM method append() is used to insert content at the end of the
selected elements.
52. Which jQuery DOM method is used to insert content at the beginning of the
selected elements?
A. insert()
B. before()
C. append()
D. prepend()
Answer: D) prepend()
Explanation:
The jQuery DOM method prepend() is used to insert content at the beginning of the
selected elements.
53. Which jQuery DOM method is used to insert content after the selected
elements?
A. after()
B. postpend()
C. addafter()
D. prepend()
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
Answer: A) after()
Explanation:
The jQuery DOM method after() is used to insert content after the selected
elements.
54. Which jQuery DOM method is used to insert content before the selected
elements?
A. before()
B. addbefore()
C. addprepend()
D. prepend()
Answer: A) before()
Explanation:
The jQuery DOM method before() is used to insert content before the selected
elements.
55. Which is the correct syntax to insert content at the end of the <p>
elements?
A. $("#p").append("Text to be added");
B. $("p").before("Text to be added");
C. $("p").append("Text to be added");
D. $("p").prepend("Text to be added");
Explanation:
The correct syntax to insert content at the end of the <p> elements is:
$("p").append("Text to be added");
56. Which is the correct syntax to insert content at the beginning of the <p>
elements?
A. $("#p").before("Text to be added");
B. $("p").addafter("Text to be added");
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
C. $("p").after("Text to be added");
D. $("p").prepend("Text to be added");
Explanation:
The correct syntax to insert content at the beginning of the <p> elements is:
$("p").prepend("Text to be added");
57. Which is the correct syntax to insert content after the <div> elements?
A. $("div").after("Text to be added");
B. $("div").postpend("Text to be added");
C. $("div").addafter("Text to be added");
D. $("#div").after("Text to be added");
Explanation:
The correct syntax to insert content after the <div> elements is:
$("div").after("Text to be added");
58. Which is the correct syntax to insert content before the <div> elements?
A. $("div").before("Text to be added");
B. $("div").pretpend("Text to be added");
C. $("div").addbefore("Text to be added");
D. $("#div").before("Text to be added");
Explanation:
The correct syntax to insert content before the <div> elements is:
$("div").before("Text to be added");
A. remove() removes the selected element and its child elements while empty()
removes the child elements of the selected element
B. remove() removes the child elements of the selected element while empty()
removes the selected elements and its child elements
C. remove() removes the child elements while empty() removes the content of
the selected element
D. remove() removes the child elements while empty() removes the content of
the selected element and its child elements
Answer: A) remove() removes the selected element and its child elements while
empty() removes the child elements of the selected element
Explanation:
The difference between remove() and empty() methods is: remove() removes the
selected element and its child elements while empty() removes the child elements of
the selected element.
60. Write a jQuery statement to remove all <p> elements with class="prog"?
A. $(".prog").remove();
B. $("p").empty(".prog");
C. $("p").remove(".prog");
D. $("[Link]").remove();
Answer: C) $("p").remove(".prog");
Explanation:
The jQuery statement to removes all <p> elements with class="prog" is:
$("p").remove(".prog");
61. Which method is used to add CSS class to the selected elements?
A. add()
B. addClass()
C. addClasses()
D. AddClasses()
Answer: B) addClass()
Explanation:
©All Rights Reserved, Fortune Cloud Technologies Group, Pune
[Link] | +91 – 9766439090 / 7083777567
The jQuery method addClass() is used to add CSS class to the selected elements.
62. Can we add more than one CSS classes to the selected elements using the
addClass() method?
A. Yes
B. No
Answer: A) Yes
Explanation:
Yes, we can add more than one CSS classes to the selected elements using
the addClass() method.
63. Which method is used to remove CSS class to the selected elements?
A. removeCSS()
B. removeClass()
C. removeClasseses()
D. RemoveClass()
Answer: B) removeClass()
Explanation:
The jQuery method removeClass() is used to remove CSS class to the selected
elements.
64. Which method is used to set or get the CSS style attribute?
A. cssAttribute()
B. attribute()
C. attr()
D. css()
Answer: D) css()
Explanation:
The jQuery method css() is used to get or set the CSS style attribute.
A. css("propertyname");
B. css(propertyname);
C. css(".propertyname");
D. css("#propertyname");
Answer: A) css("propertyname");
Explanation:
The correct syntax to get the value of a CSS style attribute/property using
the css() method is: css("propertyname");
66. Which is the correct syntax to set the value of a CSS style
attribute/property using the css() method?
A. css("propertyname"="value");
B. css("propertyname","value");
C. css("propertyname":"value");
D. css("propertyname":="value");
Answer: B) css("propertyname","value");
Explanation:
The correct syntax to set the value of a CSS style attribute/property using
the css() method is:
css("propertyname","value");
67. Which is the correct jQuery statement to set background color and text
decoration to all <p> elements?
Explanation:
68. Which jQuery method is used to get or set the width of an HTML element?
A. cssWidth()
B. Csswidth()
C. lenght()
D. width()
Answer: D) width()
Explanation:
The jQuery method width() is used to get or set the width of an HTML element.
69. Which jQuery method is used to get or set the height of an HTML element?
A. cssHeight()
B. CssHeight()
C. height()
D. getHeight()
Answer: C) height()
Explanation:
The jQuery method height() is used to get or set the height of an HTML element.