Why are you using the long dead document.write() statements - they were replaces at the end of the 20th Century by alert() which in turn was replaced a few years ago by console.log() - at least in so far as this sort of testing is concerned. Of course you wouldn’t use any of those in the final live page…
That’s what I assumed when I said that document.write was replaced by alert() at the end of the 20th Century and by console.log() more recently.
Currently the appropriate call to use for testing purposes is console.log() and not the long dead (ought to have been removed from JavaScript long ago) document.write.
Anyway, what about if you decided to serve the pages as XHTML instead of HTML (assuming you don’t need to support IE8) then document.write would just give an error as it isn’t permitted in XHTML pages - whereas the antiquated alert() and modern console.log() would still work…
The easiest way is just to look at the html element in Firebug (or developer tools in chrome) and you will see the classes that have been added to the html element by modernizr depending on what is supported etc.
As you can see borderradius is included in my example so the following will work assuming this is the most specific style.
.borderradius body{background:red}
If it doesn’t work then you either have more specific rules in your stylesheet or your body is wholly covered by an inner element’s background such as a page wrapper.
I’m not quite sure why you would want to change the background colour for the body based on if border-raidus is supported though?