Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3599940
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:25:53+00:00 2026-05-18T20:25:53+00:00

Here’s my situation: I am editing an application’s CSS style sheet. I can ONLY

  • 0

Here’s my situation:

  1. I am editing an application’s CSS style sheet.
  2. I can ONLY edit the CSS style sheet (unless I can creatively glom onto another file using the CSS, or possibly add a small jQuery prepend statement in an existing .js)
  3. Application is ONLY ie6, ie7 and ie8 compliant. They never use FireFox, and it’s not an option.

Looking for help with:

1) I think I need to use jQuery to “prepend/prependTo” a “doctype ” on to

html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"

Without the !doctype it throws ie8 into quirksmode and of course doesn’t accept any styles such as “input[type=checkbox]”

I have not used prepend before. Can you help me with full and correct syntax on how to make the following:

CURRENT: <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

DESIRED: <doctype html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

This has not worked for me yet $("html ").prepend("doctype ")

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:25:53+00:00Added an answer on May 18, 2026 at 8:25 pm

    It’s not <doctype html>. It’s:

    <!DOCTYPE html>
    <html (xmlns or any other attributes you want)>
    

    <!DOCTYPE is not an element. It has <! at the start, which is invalid for an element. This is the the “doctype declaration”, and it cannot usefully be altered after initial parsing.

    Even on browsers whose DOM interfaces let you move/replace the DocumentType node representing the doctype declaration, this does not have the effect of changing between Quirks and Standards mode, which is something that is decided only at initial load time. You cannot mutate a document between modes.

    You can load a new document from the existing document but with a changed mode:

    <!-- no doctype, loads in Quirks Mode (BackCompat) -->
    <html>
        <!-- rest of the document, then at the end: -->
    
        <script>
            alert('now in compatMode '+document.compatMode);
            if (document.compatMode==='BackCompat') {
                setTimeout(function() {
                    var markup= document.documentElement.innerHTML;
                    markup= '<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">'+markup+'</html>';
                    document.open();
                    document.write(markup);
                    document.close();
                }, 0);
            }
        </script>
    </html>
    

    But I would strongly advise against it. It’s ugly, will reset any state and redraw at the end of load time, and has all sorts of negative implications for scripting.

    If you want Standards Mode, you really need to be adding the doctype to the HTML itself. If you absolutely can’t touch the application, how about using an ISAPI filter (assuming your web server is IIS) to add the doctype to its HTML output?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a problem I ran into recently. I have attributes strings of the form
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
Here is a simplification of my database: Table: Property Fields: ID, Address Table: Quote
Here is my code, which takes two version identifiers in the form 1, 5,
Here's a coding problem for those that like this kind of thing. Let's see
Here is the scenario: I'm writing an app that will watch for any changes
Here's an interesting problem. On a recently installed Server 2008 64bit I opened IE
Here we go again, the old argument still arises... Would we better have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.