jQuery Tutorial


jQuery Example


jQuery References


jQuery HTML attr() Method Reference


  All jQuery with HTML Method References


Uses

jQuery attr() method Set attribute and value of selected elements.


Syntax

$(selector).attr(attribute)

jQuery attr() method supported following parameters.

ParameterDescription
attributeattribute is Required parameter. get the value of attribute.

jQuery attr() Method Example

<script type="text/javascript"> 
$(document).ready(function(){
  $("button").click(function(){
	$("p").attr("align","center");
  });
});
</script>
Online Try This Code Your Self....   »

  All jQuery with HTML Method References