www.webdeveloper.com
Results 1 to 2 of 2

Thread: Creating <object> element does not create </object> element

  1. #1
    Join Date
    Jun 2009
    Location
    Portland, Maine
    Posts
    9

    Question Creating <object> element does not create </object> element

    When I do this:
    var newObj = document.createElement("object");

    the object is created, but there is no </object> element created.

    If I do this:
    var newObj = document.createElement("object");
    var endObj = document.createElement("/object");
    var frag = document.createDocumentFragment();
    frag.appendChild(newObj);
    frag.appendChild(endObj);

    it doesn't create anything.

    Is the code wrong, or is the createElement not working?

    Thanks.

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    You are confusing elements with tags and the resulting document with the HTML that created it. The element that results from document.createElement ('object') would be turned into HTML as <object></object>.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles