zoukankan      html  css  js  c++  java
  • 一个用于每一天JavaScript示例-SVG中间javaScript画廊

    <?xml version="1.0" standalone="no"?

    > <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> <script type="text/javascript"> <![CDATA[ window.onload = function(){ var square = document.getElementById("square"); square.onclick = function(){ var color = this.getAttribute("fill"); console.log(color); if(color =="#f00"){ this.setAttribute("fill","#00f"); }else{ this.setAttribute("fill","#f00"); } } } ]]> </script> <rect id= "square" x="10" y="10" width="400" height="400" style="stroke:pink;stroke-5; fill-opacity:0.1;stroke-opacity:0.9" fill="#00f"/> </svg>


    版权声明:本文博客原创文章,博客,未经同意,不得转载。

  • 相关阅读:
    CTF SQL注入知识点
    Rot13加密算法
    LFU缓存
    Redability
    快排
    更新卡片的zIndex
    webshell文件下载器
    [转]背包九讲
    hihocoder第196周
    Python import容易犯的一个错误
  • 原文地址:https://www.cnblogs.com/mfrbuaa/p/4615642.html
Copyright © 2011-2022 走看看