4.2 屬性(Attributes)的操控
.attr():取得屬性值與修改
$("#p1").attr("id");$("#p1").attr("id", "another_id");$("a#link2").attr("href", "https://www.books.com.tw/").attr("style", "color: red;font-size: 30px;");$("a#link2").attr({
"href": "https://www.books.com.tw/",
"style": "color: red;font-size: 30px;"
});.removeAttr():移除屬性
Last updated