HTML/CSS & Js - Test

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Newminds
N
Newminds
Community Contributor
Quizzes Created: 1 | Total Attempts: 1,451
Questions: 21 | Attempts: 1,454

SettingsSettingsSettings
HTML Quizzes & Trivia

Introtest inför New Minds Trainee-program


Questions and Answers
  • 1. 

    What is the syntax for inserting the image picture.jpg?

    • A.

      <src="picture.jpg" />

    • B.

      <picture="picture.jpg" />

    • C.

      <img="picture.jpg" />

    • D.

      <img src="picture.jpg" />

    • E.

      <image src="picture.jpg" />

    Correct Answer
    D. <img src="picture.jpg" />
    Explanation
    The correct syntax for inserting the image "picture.jpg" is . This syntax uses the tag and the "src" attribute to specify the source file of the image.

    Rate this question:

  • 2. 

    To create a link to an anchor, you use the ______ property in A tag.

    • A.

      Name

    • B.

      Tag

    • C.

      Link

    • D.

      Href

    Correct Answer
    D. Href
    Explanation
    To create a link to an anchor, you use the "href" property in the A tag. The "href" property specifies the URL of the page or the anchor to which the link should navigate. By setting the "href" attribute to the desired anchor's ID, you can create a link that takes the user directly to that specific section of the page when clicked.

    Rate this question:

  • 3. 

    HTML Tags are case sensitive.

    • A.

      True

    • B.

      False

    • C.

      Not in HTML 5

    • D.

      Onlyin HTML 5

    Correct Answer
    A. True
    Explanation
    HTML tags are case sensitive, meaning that the opening and closing tags must be written in the correct case in order for them to be recognized by the browser. For example, is different from and will be treated as a different tag. This is important to keep in mind when writing HTML code to ensure that the tags are used correctly and consistently throughout the document.

    Rate this question:

  • 4. 

    What does XHTML stands for?

    • A.

      EXtra Hypertext Markup Language

    • B.

      EXtension Hypertext Markup Language

    • C.

      EXtensible Hypertext Markup Language

    • D.

      EXtended Hypertext Markup Language

    • E.

      None of the above

    Correct Answer
    C. EXtensible Hypertext Markup Language
    Explanation
    XHTML stands for eXtensible Hypertext Markup Language. This is a markup language that is used to structure and format content on the web. It is an extended version of HTML, allowing for greater flexibility and compatibility with different devices and platforms. XHTML follows strict rules and guidelines, making it easier for web browsers and search engines to interpret and display web pages correctly.

    Rate this question:

  • 5. 

    What is the correct HTML for referring to an external style sheet?

    • A.

      <link rel="stylesheet" type="text⁄css" href="style.css" />

    • B.

      <link href="style.css" />

    • C.

      <link style.css />

    • D.

      <link stylesheet="style.css" />

    Correct Answer
    A. <link rel="stylesheet" type="text⁄css" href="style.css" />
    Explanation
    The correct HTML for referring to an external style sheet is . This is because the element is used to link an external resource to an HTML document, and the rel attribute specifies the relationship between the current document and the linked resource. In this case, the rel attribute is set to "stylesheet" to indicate that the linked resource is a style sheet. The type attribute is set to "text⁄css" to specify the MIME type of the linked resource, and the href attribute is used to specify the location of the style sheet file.

    Rate this question:

  • 6. 

    Which is the correct CSS syntax?  

    • A.

      Body {color: black}

    • B.

      Body:color=black

    • C.

      {body;color:black}

    • D.

      {body:color=black(body}

    Correct Answer
    A. Body {color: black}
    Explanation
    The correct CSS syntax is "body {color: black}". In CSS, selectors are used to target HTML elements, and in this case, the "body" selector is used to target the body element. The curly braces {} are used to enclose the declaration block, which contains the property "color" and its value "black". This syntax specifies that the text color of the body element should be black.

    Rate this question:

  • 7. 

    Which of the following isn't an feature/element from HTML5?

    • A.

      Canvas

    • B.

      Video

    • C.

      Close

    • D.

      Web Workers

    Correct Answer
    C. Close
    Explanation
    The "Close" element is not a feature or element from HTML5. HTML5 does not have a specific element called "Close". The other options mentioned, such as Canvas, Video, and Web Workers, are all features or elements that are part of HTML5.

    Rate this question:

  • 8. 

    Whitin which element should you insert meta-tags?

    • A.

      <head></head>

    • B.

      <header></header>

    • C.

      <footer></footer>

    • D.

      <div></div>

    Correct Answer
    A. <head></head>
    Explanation
    Meta-tags are used to provide metadata about an HTML document. They are typically placed within the head element of an HTML document. The head element is responsible for containing meta-information about the document, such as the title, character encoding, and other important information. Placing meta-tags within the head element ensures that they are properly recognized by search engines and other web services that utilize this information. Therefore, the correct place to insert meta-tags is within the head element, as shown in the answer option.

    Rate this question:

  • 9. 

    Which HTML code is correct?

    • A.

      <form method = "SEND" action = "send.php">

    • B.

      <form method = "GET" action = "send.php">

    • C.

      <form method = "INPUT" action = "send.php">

    • D.

      <form function= "GET" action = "send.php">

    • E.

      <form function= "POST" action = "send.php">

    Correct Answer
    B. <form method = "GET" action = "send.pHp">
    Explanation
    The correct answer is "" because the "method" attribute specifies the HTTP method to be used when submitting the form, and "GET" is the method used to retrieve data from the server. The "action" attribute specifies the URL where the form data should be submitted.

    Rate this question:

  • 10. 

    WHat is the correct doctype declaration for HTML 5?

    • A.

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5 Transitional//EN" "http://www.w3.org/TR/html5/loose.dtd">

    • B.

      <!DOCTYPE html5>

    • C.

      <!DOCTYPE TYPE = "html5">

    • D.

      <!DOCTYPE HTML PUBLIC src = "http://www.w3.org/TR/html5/loose.dtd">

    • E.

      <!DOCTYPE html>

    Correct Answer
    E. <!DOCTYPE html>
    Explanation
    The correct doctype declaration for HTML 5 is "". This declaration is used to specify the version of HTML being used in the document. In HTML 5, the doctype declaration is simplified to just "".

    Rate this question:

  • 11. 

    Nu är det dags för lite Java Script! Vad kommer det att bli för output av följande kod? (function(){ return typeof arguments; })();

    • A.

      “object”

    • B.

      “array”

    • C.

      “arguments”

    • D.

      “undefined”

    Correct Answer
    B. “array”
    Explanation
    The code snippet is an immediately invoked function expression (IIFE) that returns the type of the "arguments" object. The "arguments" object is an array-like object that contains the arguments passed to a function. Since the "arguments" object behaves like an array, the typeof operator returns "object". However, in this specific case, the typeof operator returns "array" because the code is executed in a browser environment where the "arguments" object is automatically converted to an array-like object with additional array methods.

    Rate this question:

  • 12. 

    (function(x){ delete x; return x; })(1);

    • A.

      1

    • B.

      Null

    • C.

      Undefined

    • D.

      Error

    Correct Answer
    A. 1
    Explanation
    The given code is a self-invoking function that takes an argument 'x'. Inside the function, the 'delete' operator is used to delete the variable 'x'. However, since 'x' is a function parameter, it cannot be deleted and the 'delete' operator has no effect. The function then returns the value of 'x', which is 1. Therefore, the correct answer is 1.

    Rate this question:

  • 13. 

    Var y = 1, x = y = typeof x; x;

    • A.

      1

    • B.

      “number”

    • C.

      Undefined

    • D.

      “undefined”

    Correct Answer
    D. “undefined”
    Explanation
    The code initializes the variables y and x with the value of 1. Then, it assigns the value of the typeof x to y. Since x has not been assigned any value before, its typeof is "undefined". Therefore, the value of y becomes "undefined". Finally, the code tries to access the value of x, which is also "undefined".

    Rate this question:

  • 14. 

    (function f(f){ return typeof f(); })(function(){ return 1; });

    • A.

      “number”

    • B.

      “undefined”

    • C.

      “function”

    • D.

      Error

    Correct Answer
    A. “number”
    Explanation
    The given code snippet is an example of a self-invoking function. It defines a function f and immediately calls it. The function f takes a parameter f, which is itself a function. Inside the self-invoking function, the typeof operator is used to determine the type of the result of calling the function f. In this case, the function f returns the number 1, so the typeof operator will return "number". Therefore, the correct answer is "number".

    Rate this question:

  • 15. 

    Var foo = { bar: function() { return this.baz; }, baz: 1 }; (function(){ return typeof arguments[0](); })(foo.bar);

    • A.

      “undefined”

    • B.

      “object”

    • C.

      “number”

    • D.

      “function”

    Correct Answer
    A. “undefined”
    Explanation
    The code defines an object called "foo" with two properties: "bar" and "baz". The "bar" property is a function that returns the value of the "baz" property. The code then immediately invokes an anonymous function, passing in the "foo.bar" function as an argument. Inside the anonymous function, the "arguments[0]()" expression is called, which executes the "foo.bar" function. However, since the function is invoked without any specific context (i.e., "this" is not explicitly defined), the value of "this" inside the "bar" function will be the global object (or undefined in strict mode), and the global object does not have a "baz" property. Therefore, the expression will return "undefined".

    Rate this question:

  • 16. 

    Var foo = { bar: function(){ return this.baz; }, baz: 1 } typeof (f = foo.bar)();

    • A.

      “undefined”

    • B.

      “object”

    • C.

      “number”

    • D.

      “function”

    Correct Answer
    A. “undefined”
    Explanation
    The code snippet declares an object named "foo" with two properties: "bar" and "baz". The "bar" property is a function that returns the value of the "baz" property. The "baz" property is assigned the value 1. The expression "typeof (f = foo.bar)();" assigns the function "foo.bar" to the variable "f" and immediately calls it. Since the function is called without any context, the "this" keyword inside the function refers to the global object (window in a browser). However, the global object does not have a "baz" property, so the function returns "undefined". Therefore, the correct answer is "undefined".

    Rate this question:

  • 17. 

    Var f = (function f(){ return "1"; }, function g(){ return 2; })(); typeof f;

    • A.

      “string”

    • B.

      “number”

    • C.

      “function”

    • D.

      “undefined”

    Correct Answer
    B. “number”
    Explanation
    The code snippet defines a variable "f" that is immediately assigned the result of invoking two functions using the comma operator. The first function returns a string "1" and the second function returns the number 2. Since the comma operator evaluates each expression and returns the result of the last expression, the value assigned to "f" is 2. Therefore, the typeof "f" is "number".

    Rate this question:

  • 18. 

    Var x = 1; if (function f(){}) { x += typeof f; } x;

    • A.

      1

    • B.

      “1function”

    • C.

      “1undefined”

    • D.

      NaN

    Correct Answer
    C. “1undefined”
    Explanation
    The code first declares a variable x and assigns it the value 1. Then, it checks if a function named f exists. Since the function f is defined within the if statement and is not called, it is considered a truthy value. As a result, the code inside the if statement is executed, which concatenates the string "undefined" to the value of x. Therefore, the final value of x is "1undefined".

    Rate this question:

  • 19. 

    Var x = [typeof x, typeof y][1]; typeof typeof x;

    • A.

      “number”

    • B.

      “string”

    • C.

      “undefined”

    • D.

      “object”

    Correct Answer
    B. “string”
    Explanation
    The code declares a variable "x" and assigns it the value of the second element in the array [typeof x, typeof y], which is "typeof y". Since "y" is not defined, its type is "undefined". Then, the code uses the "typeof" operator twice on "x". The first "typeof" operator returns the type of "typeof y", which is a string. Therefore, the second "typeof" operator returns the type of the string, which is also a string. Hence, the answer is "string".

    Rate this question:

  • 20. 

    (function(foo){ return typeof foo.bar; })({ foo: { bar: 1 } });

    • A.

      “undefined”

    • B.

      “object”

    • C.

      “number”

    • D.

      Error

    Correct Answer
    A. “undefined”
    Explanation
    The given code is an immediately-invoked function expression (IIFE) that takes an object as an argument and returns the type of the property "bar" of the object. In this case, the argument object has a property "foo" which itself has a property "bar" with a value of 1. However, when trying to access the property "bar" using "foo.bar", it returns "undefined" because "foo" does not have a property called "bar". Therefore, the correct answer is "undefined".

    Rate this question:

  • 21. 

    Förklara vad DOM innebär och varför detta är så viktigt när det gäller att kombinationen mellan HTML och Java Script

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Feb 22, 2013
    Quiz Created by
    Newminds
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.