JQuery doenst work if I include from external file

JQuery doenst work if I include from external file

Hi all :),

I am rather new to JQuery but this is really something I can't get my head around...
I've got this code:

  1. $('select').change(function() {
  2.     pos = $(this).attr("id");
  3.     if (pos == "sector" && $('#sector').val() == 2) {
  4.         $('#TextAreaDiv').fadeIn("slow");
  5.     }   
  6.     else {
  7.         $('#TextAreaDiv').fadeOut("slow");
  8.     }
  9. });

  10. var i= 0;
  11. function addField(){
  12.     $('#TextAreaDiv').append('<input type="text" name="myinput'+i+'" />');
  13.     i++;
  14.     return false;
  15. }

If I put this in my .php file where the div is created it works, but if I include from an external file in doesn't react. Could anyone give me push in the right direction?

ps. Yes the link to include is CORRECT! ;)