<svg xmlns="http://www.w3.org/2000/svg" height="200" width="400"> | |
<style type="text/css"> | |
.fail { fill: red; } | |
.pass { fill: green; } | |
</style> | |
<rect x="0" y="0" width="400" height="200" class="fail"/> | |
<script type="text/javascript"> | |
document.getElementsByTagNameNS('http://www.w3.org/2000/svg', 'rect')[0].setAttribute('class', 'pass'); | |
</script> | |
</svg> |