Angi enkeltattributt
$("img").attr("src", "/images/banner.jpg.webp");
Angi enkelt attributt (med funksjon)
$("div").attr("id", function (arr) ( return "div-id" + arr; ))
Angi flere attributter
$("img").attr(( src: "/images/banner.jpg.webp", title: "banner", alt: "banner" ));
Få attributt
var $source = $("img").attr("src");