SVG LineElement.x1 Property Last Updated : 30 Mar, 2022 Improve Improve Like Article Like Save Share Report The SVG LineElement.x1 property returns an SVGAnimatedLength object corresponding to the attribute of the given line element. Syntax: LineElement.x1 Return value: This property returns SVGAnimatedLength object that can be used to get the “x1” of the line element. Example 1: HTML <!DOCTYPE html> <html> <body> <svg width="350" height="350" xmlns="http://www.w3.org/2000/svg"> <line x1="10" x2="150" y1="10" y2="150" id="gfg" stroke="green" /> <script> var g = document.getElementById("gfg"); console.log(g.x1); </script> </svg> </body> </html> Output: Example 2: HTML <!DOCTYPE html> <html> <body> <svg width="350" height="350" xmlns="http://www.w3.org/2000/svg"> <line x1="100" x2="150" y1="10" y2="150" id="gfg" stroke="green" /> <script> var g = document.getElementById("gfg"); console.log(g.x1) </script> </svg> </body> </html> Output: Like Article Suggest improvement Previous SVG LineElement.y2 Property Next SVG LineElement.y1 Property Share your thoughts in the comments Add Your Comment Please Login to comment...