Strange safari's behaviour

I am using JS to split my ePub chapter into pages. I wrap code with the new divs that will represent separate page. Also my CSS has style for new divs. Everything is fine while my file has filename extension 'html', but that ePub provide xml files and in Safari style for new divs are not applied. (I can rename file, and renamed xml to html start to wok). What I am doing wrong? Thanks for any help!

UPDATE link to xml to html


Got IT! The piece of code that caused it:

var wrapper = document.createElement( 'div' );

And it should be replaced with

var wrapper = document.createElementNS ? 
              document.createElementNS( '', 'div' ) 
              :document.createElement( 'div' );

Need Your Help

Display message upon Switch button toggle

jquery checkbox twitter-bootstrap-3 bootstrap-switch

I am using Bootstrap Switch to turn my check-box in toggle switches.