title: Filling Input fields having credit card formatting using js
body: <p>I was wondering if there is a way to fill the input fields having type text and have inbuilt js event to evaluate what is being entered means, when a user types in any number it evaluates and checks the type of card and also put automatic spaces in between. But while setting the value with javascript i.e. <code>element.value = 'xxxxxxxx';</code> the formatting doesn't happen and the site evaluates the card number invalid. so how to programmatically achieve this. I am working on an extension which could auto fill card details.</p>
  <p>I have tried using <code>element.dispatchEvent(Keyboardevent)</code> but it won't work.</p>
  <p>the website on which i am trying is made on top of angular.</p>