javascript - 更改标签的属性值

标签 javascript jquery

我有一些这样的标签:

<path d="M 782.5 421 C 787.828 421 787.828 429 782.5 429 C 777.172 429 777.172 421 782.5 421 Z"
fill="#4572A7" stroke="#FFFFFF" stroke-width="0.000001" width="8" height="8"></path>

我希望所有标签都有更大的宽度和高度,而不是 8。但我很困惑,因为它们不在 style 属性中。如何通过 javascript 或 jquery 更改它们?

最佳答案

$('path').attr({width: 16, height: 16})

http://api.jquery.com/attr

关于javascript - 更改标签的属性值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11865094/

相关文章:

jquery - 了解 Video.JS 是否使用 HTML5 或 Flash Player

javascript - Thorax 2.0.1 在构建我的 View 时抛出 `Cannot read property ' _thoraxBind' of undefined`

javascript - 根据原始值更改输入值

javascript - JS/ES6 : How to get specific fields of object array and return a single object with specific value?

javascript - 指定 jQuery 选择器引用的 HTML 页面?

javascript - 如何突出显示分布在多个标签上的句子

Javascript:在脚本中声明全局变量并在另一个脚本中使用它

javascript - 如何在变量上应用 jquery 函数?

具有定义的寻呼机链接的 jQuery Cycle

jquery - 动态导航中的水平线