Web Development with jQuery®

(Elliott) #1

(^134) ❘ CHAPTER 4 MANIPULATING CONTENT AND ATTRIBUTES



  1. If an element contains HTM content and you retrieve the content of that element using
    jQuery’s text() method, will the HTML tags be present in the returned value?

  2. If you set an element’s content using jQuery’s text() method and that content contains
    HTML tags, will the HTML tags be visible in the rendered output displayed in your browser’s
    viewport?

  3. Describe one bug that jQuery’s append() and prepend() methods work around in IE when
    compared to innerHTML.

  4. Describe one bug that jQuery’s append() and prepend() methods work around in Firefox when
    compared to innerHTML.

  5. If you want to insert existing content within a document before other existing content within
    a document, what jQuery method might be best suited for this task?

  6. What jQuery method might you use if you needed to wrap multiple items in a document in
    a single element?

  7. jQuery’s replaceWith() method is most similar to what de facto standard JavaScript property?

  8. What jQuery method would you use if you want to completely remove an item and all its
    children from your document?

  9. What jQuery function call would you make if you want to duplicate an element and its event
    handlers and insert the duplicate element elsewhere in the document?


http://www.it-ebooks.info

Free download pdf