Source du fichier SVG

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="200">
<script><![CDATA[
function change_attribut(evt)
{
        var objet = evt.target;
        objet.setAttributeNS(null , "width" , "200");
        objet.setAttributeNS(null , "height" , "80");
        objet.setAttributeNS(null , "fill" , "red")
}
]]></script>
<g id="affiche">
<text id="texte" x="150" y="50" text-anchor="middle" font-size="20" font-family="Arial" fill="red">Cliquez sur le rectangle</text>
<rect id="rectangle" onclick="change_attribut(evt)" x="50" y="100" width="100" height="50" fill="green"/>
</g>
</svg>