如何使用JQuery获取有关特定标记的信息?

如何使用JQuery获取有关特定标记的信息?,jquery,Jquery,例如,其中一个具有以下特性: <div id="hat" re="mouse" > text here </div> $(.#hat).re = ?????? 这里的文本 $(.#hat).re=?????? 如果要更新re属性的值,只需编写以下命令: $('#hat').attr('re', 'newValue'); 如果要更新re属性的值,只需编写以下命令: $('#hat').attr('re', 'newValue'); $('#hat').attr('r

例如,其中一个具有以下特性:

<div id="hat" re="mouse" > text here </div>

$(.#hat).re = ??????
这里的文本
$(.#hat).re=??????

如果要更新re属性的值,只需编写以下命令:

$('#hat').attr('re', 'newValue');

如果要更新re属性的值,只需编写以下命令:

$('#hat').attr('re', 'newValue');
$('#hat').attr('re')

你会明白的

$('#hat').attr('re', 'blah'); 
将设置它

$('#hat').attr('re')

你会明白的

$('#hat').attr('re', 'blah'); 
将设置它

值为$('hat').attr('re')值为$('hat').attr('re'))