Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 在html中使用未定义的属性是标准的吗_Jquery_Html_Css - Fatal编程技术网

Jquery 在html中使用未定义的属性是标准的吗

Jquery 在html中使用未定义的属性是标准的吗,jquery,html,css,Jquery,Html,Css,我有时使用未定义的属性 范例 然而,我不确定这是正确的使用方式还是非标准的使用方式 对不起我的英语。谢谢,请改用数据url,这是 或: 改为使用数据url,这是错误的 或: 还有,我还想问其他问题。对不起,我试着用我拙劣的英语技能搜索,但失败了……T_TAlso和我想还有其他问题。对不起,我试着用我拙劣的英语技能搜索,但失败了……T_Tdata-*attributes@Joseph Cheers updated answerdata-*attributes@Joseph Cheers updat

我有时使用未定义的属性

范例

然而,我不确定这是正确的使用方式还是非标准的使用方式

对不起我的英语。谢谢,请改用数据url,这是

或:

改为使用数据url,这是错误的

或:


还有,我还想问其他问题。对不起,我试着用我拙劣的英语技能搜索,但失败了……T_TAlso和我想还有其他问题。对不起,我试着用我拙劣的英语技能搜索,但失败了……T_Tdata-*attributes@Joseph Cheers updated answerdata-*attributes@Joseph Cheers updated answerdata-*attributes@Joseph Cheers updated answer
<ul>
  <li id="goFirst" url="abcd.jsp">menu1</li>
  <li id="goSecond" url="abcd2.jsp">menu2</li>
</ul>
var url = $("#goFirst").attr(url);
location.href="url";
<li id="goFirst" data-url="abcd.jsp">
var url = $("#goFirst").attr("data-url");
var url = $("#goFirst").data("url");