Add javascript file to form via #attached with additional data

Public

Get raw version
php
  1. //inside hook form alter or similar
  2. $form['#attached']['js'][drupal_get_path('module', 'mymodule') . '/mymodule.js'] = array(
  3. 'weight' => 99999,
  4. //other properties
  5. );