“生成的”在哪里?归因允许吗?

发布于 2025-01-01 22:07:20 字数 322 浏览 3 评论 0原文

我在 IntelliJ 中收到此错误:

此处不允许使用“生成”属性

html 片段所在位置:

<label generated="true" ... >

生成 是“真正的”HTML 属性吗?如果验证失败,它会由 jquery-ui-validation 插件添加到错误字段上。哪里允许呢?

I'm getting this error in IntelliJ:

Attribute 'generated' is not allowed here

Where the html snippet is:

<label generated="true" ... >

Is generated a "real" HTML attribute? It is added by the jquery-ui-validation plugin, on the error fields if validation fails. Where is it allowed?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栀子花开つ 2025-01-08 22:07:20

原始答案:什么是“某些 HTML 标记中出现的“generate”属性用于做什么?

这是自定义数据用户定义 属性。在您的例子中,它被添加来表示加载后在页面上生成的元素,可能是由 JavaScript 生成的。

在繁重的 UI/UX Web 应用程序中经常会看到其他此类属性。它们通常充当技术(CSS、JavaScript、HTML 等)之间的挂钩

请注意,此类属性不会进行验证。如果您使用的是 HTML5,则可以使用 data- 前缀来解决此问题(即 data- generated="true")。详细了解有关 HTML5 中的自定义数据属性

orignal answer at : What is the "generated" attribute seen in some HTML tag used for?

This is a custom data or user-defined attribute. In your case it has been added to denote an element that was generated on the page after it loaded, probably by JavaScript.

It's common to see other such attributes in heavy UI/UX web applications. They typically serve as hooks between technologies - CSS, JavaScript, HTML, etc.

Note that such attributes do not validate. If you are using HTML5, you can prefix them with data- to get around this issue (i.e. data-generated="true"). Read more about custom data attributes in HTML5.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文