AngularJS supports .prop() jQuery functionality. Here in below examples we can see how to set and remove property  of an element.

Steps to read attribute value of an element :

  1. Get angular element of html element
  2. Use .prop('property name') method to read the property value
var myEl = angular.element( document.querySelector( '#inputID' ) );
alert(myEl.prop('checked'));

Steps to set attribute value of an element :

  1. Get angular element
  2. Use .prop('property name', 'property value') method to set the property value
var myEl = angular.element( document.querySelector( '#inputID' ) );
myEl.prop('checked',true);

0 comments:

Blogroll

Follow this blog by Email

Popular Posts