<!DOCTYPE html>
<html>
<head>
</head>
<body onload="document.getElementById('q').appendChild(document.createTextNode('C'));">
<div style="white-space: pre; direction: rtl;">A<div id="q" style="text-transform: capitalize;">B
<div></div></div></div>
</body></html>