HTML中的数据输入是什么?
<!DOCTYE html>
<html lang="ae-ar">
<head data-info="f:msnallexpuser,muiflt13cf">
我不理解上述数据信息的功能
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
<!DOCTYE html>
<html lang="ae-ar">
<head data-info="f:msnallexpuser,muiflt13cf">
我不理解上述数据信息的功能
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
数据 - *
html中的属性存储自定义值。该存储的数据可以在JavaScript中检索。在您的情况下,data-info
是属性名称,其值为f:msnallexpuser,muiflt13cf
。可以在JavaScript中使用getAttribute
函数检索值。data-*
attribute in HTML stores custom values. This stored data can be retrieved in JavaScript. In your case,data-info
is the attribute name and its value isf:msnallexpuser,muiflt13cf
. Value can be retrieved usinggetAttribute
function in JavaScript.您可以使用
el。 getAttribute('data-whate')
要在JavaScript中获取数据属性,但是获取HTML数据属性的更好方法是使用el.dataset.thythy
,你想要。您还可以使用
content:attr(data-whit why/code>或selector:
中获取数据属性。 > [data-whith][data-white ='value']
或content:attr(data-whit whither)
You could use
el.getAttribute('data-whatever')
to get the data attribute in JavaScript however a better way to get the HTML data attribute is to useel.dataset.whatever
, whatever being what-ever you want.You can also get data attributes in CSS as well using the
content: attr(data-whatever)
or the selector:[data-whatever='value']
or[data-whatever]
我认为我从
如果您想要定义和用法,则我还为您复制并粘贴了它。
谢谢,最好的问候!
I think the below code which I copied from W3Schools HTML data-* Attribute tutorial will help you to understand it easily.
If you want the definition and usage, for it, I also have copied and pasted it for you.
Thanks and best regards!