How to add java script in a content type: article or blog or basic page
You can add javascript in template file using hook_preprocess_page() function.

&lt;?php
function mythemename_preprocess_page(&amp;$vars, $hook) {
  if(arg(0) === 'node' &amp;&amp; arg(1) === 'add' &amp;&amp; arg(2) === 'article') {
    drupal_add_js(path_to_theme().'/js/events.js');
  }
}
?&gt;


Other solution is that you can use theme function.

function theme_content_type_node_form($form) {
  drupal_add_js(...);
  return theme('node_form', $form);
}


This just calls the default theme function for the node add form after adding the js. As the theme function is called even the form is cached, this works nicely. You also need to implement hook_theme to make this work.