例如
<text class="more" x=5>
我可以使用 jquery 或 javascript 更改“X”的值吗
最佳答案
为什么要使用 JQuery 来完成简单的任务?
document.querySelector('text').setAttribute('x', '25');
或者,更高效一点:
document.getElementsByTagName('text')[0].setAttribute('x', '25')
关于javascript - 使用 jquery 或 javascript 更改 DOM 元素中的属性值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40654655/