Skip to content

Instantly share code, notes, and snippets.

@livingston
Last active September 5, 2015 12:45
Show Gist options
  • Save livingston/494520 to your computer and use it in GitHub Desktop.
Save livingston/494520 to your computer and use it in GitHub Desktop.
Browser Bugs

Internet Explorer

  • Create elements dynamically along with attributes using document.createElement

        document.createElement('<div id="wrapper" class="global">')
    

    This will create a div with the attributes id and class set. So the resulting element's html would look like,

        <div id=wrapper class=global></div>
    

    IE Versions 6, 7, 8

    Resources : MSDN createElement method

  • The name attribute cannot be set on a dynamically created element in run-time. So to create an element with the name attribute set, create the element with the attribute set using document.createElement

        var textField = document.createElement('input');
        textField.setAttribute('name', 'first-name'); //will not work in IE
    

    Instead use the following,

        var textField = document.createElement('<input type="text" name="first-name" />');
    

    IE Versions 6, 7

    Resources : MSDN name property, Setting the 'name ' attribute in IE

  • Background image doesn't appear for a HTML 5 element without setting the background color

    IE Versions 7

Firefox

  • min-height is ignored when box sizing is set as border-box.

    Firefox 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment