A
A
Anton2017-05-21 14:39:54
JavaScript
Anton, 2017-05-21 14:39:54

How to copy all or individual attributes of an html tag using js?

Good afternoon!
Tell me how to copy attributes through JS, for example, this fragment

<circle id="Oval" cx="621.362" cy="249.517" r="6.626"></circle>

and at the output get the values ​​cx, cy and r, well, or entirely

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor L, 2017-05-21
@Ooos

var a =document.getElementById("Oval").getAttribute("cx");
alert(a);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question