html中的href和data-href属性有什么区别<a></a>
标签?
我当前的代码写如下:
<a id="sign_in_with_facebook" href="verify_phone_process_1.html" class="btn btn-default bubbla-btn">Sign In with Facebook</a>
当我将其更改为
<a id="sign_in_with_facebook" data-href="verify_phone_process_1.html" class="btn btn-default bubbla-btn">Sign In with Facebook</a>
它没有重定向到 verify_phone_process_1.html 页面。
html标签中的href和data-href属性有什么区别?
前者实际上链接到某个地方,包含所有功能/UI(因为它是指定的作为实现这一点的属性)——而后者本身不执行任何操作,它只是一个具有任意值的任意命名的自定义数据属性。
Edit:有关自定义数据属性的更多信息:
https://developer.mozilla.org/en/docs/Web/Guide/HTML/Using_data_attributes https://developer.mozilla.org/en/docs/Web/Guide/HTML/Using_data_attributes
http://www.w3.org/TR/html5/dom.html#custom-data-attribute http://www.w3.org/TR/html5/dom.html#custom-data-attribute
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)