<object id="svgObject" data="http://demowhistle.com/svg/pe-circle.svg" type="image/svg+xml">
您的browser
不支持SVG
<script type="text/javascript">
window.onload=function() {
// Get the Object by ID
var a = document.getElementById("svgObject");
// Get the SVG document inside the Object tag
var svgDoc = a.contentDocument;
// Get one of the SVG items by ID;
var svgItem = svgDoc.getElementById("page-id-267");
// Set the colour to something else
svgItem.setAttribute("fill", "lime");
};
</script>
我需要更改页面有效颜色。