繁体   English   中英

如何通过使用其类名获取SV​​G元素

[英]How do I get SVG element by using its Classname

我的样本Svg:

<circle cx="205.45282275086475" cy="187.9788644175314" r="69.64553108419807" id="07539aec-9d5d-4747-8878-0da5d505cb5f" stroke="#010101" fill="none" stroke-width="2" data-pdf-annotate-id="07539aec-9d5d-4747-8878-0da5d505cb5f" data-pdf-annotate-type="emptycircle" onload="init(evt)"class="hide000000003d495a02706fb486" aria-hidden="true" transform="scale(0.6) rotate(0) translate(0, 0)" style="cursor: pointer;"></circle>

我如何通过使用其className获取元素

var prev_annotation = document.getElementsByClassName("hide000000003d495a02706fb486");
console.log(prev_annotation) // Am not getting the Element

我做错了什么?

您似乎放错了地方"

请尝试将此单行分成多行,以便您可以清晰地阅读代码。

<circle cx="205.45282275086475" 

cy="187.9788644175314" 

r="69.64553108419807" 

id="07539aec-9d5d-4747-8878-0da5d505cb5f"

stroke="#010101" 

fill="none" 

stroke-width="2" 

data-pdf-annotate-id="07539aec-9d5d-4747-8878-0da5d505cb5f" 

data-pdf-annotate-type="emptycircle" 

onload="init(evt)" 

class="hide000000003d495a02706fb486【**】 __web-inspector-hide-shortcut__" 

aria-hidden="true" 

transform="scale(0.6) rotate(0) translate(0, 0)" 

style="cursor: pointer;"></circle>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM