How to add java script in a content type: article or blog or basic page I need to add following kind of java script and html element in one of my computer programe coding tutorial article:

what I want to add a java script + html to create a text box to add function to copy the text inside the box on mouse click. (I know the code and html for that, but I was unable to paste that here) 

I am looking to do it through: content tab in administrative tab: add content:  article: new article creation form in full html option.

Please let me know how to do it in drupal 7: by article or blog creation form or if there is any other easy way to do it.

Thanks.
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.