【发布时间】:2013-04-01 09:36:08
【问题描述】:
为什么我们用选择标签写.attr('selected','selected')
例如:
$('#countryList option').filter(function () {
return ($(this).text() == findText); }).attr('selected','selected');
});
它的真正含义是什么?
【问题讨论】:
-
这更像是布尔属性的约定;它要么是空的,要么包含与属性名称本身相同的值。
标签: jquery select attr selected