SVG RectElement.y Propiedad

El ángulo de la propiedad SVG RectElement.y

Sintaxis:

RectElement.y

Valores devueltos: esta propiedad devuelve

Ejemplo 1: 

HTML

<!DOCTYPE html> 
<html> 
  
<body> 
    <svg width="350" height="150" 
        xmlns="http://www.w3.org/2000/svg">
        <rect width="100" height='100' 
            fill="green" id="gfg" x=20 y=30 />
  
        <script>
            var g = document.getElementById("gfg");
            console.log(g.y)
        </script>
    </svg>
</body> 
  
</html>

Producción:

Ejemplo 2: 

HTML

<!DOCTYPE html> 
<html> 
  
<body> 
    <svg width="350" height="150" 
        xmlns="http://www.w3.org/2000/svg">
  
        <rect width="100" height='100' 
            fill="green" id="gfg" x=20 y=40 />
  
        <div id="abc"></div>
  
        <script>
            var g = document.getElementById("gfg");
            var abc = document.getElementById("abc");
            abc.innerHTML = 
                "y attribute of rect element is: "
                + g.y.baseVal.value;
        </script>
    </svg>
</body> 
  
</html>

Producción:

Publicación traducida automáticamente

Artículo escrito por taran910 y traducido por Barcelona Geeks. The original can be accessed here. Licence: CCBY-SA

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *