It helps to get the value of an attribute for the first element in the set of matched elements.
// To set the width attribute of an image to 400.
$(“button”).click(function(){
$(“img”).attr(“width”,”400″);
});
It helps to get the value of an attribute for the first element in the set of matched elements.
// To set the width attribute of an image to 400.
$(“button”).click(function(){
$(“img”).attr(“width”,”400″);
});