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:
- $('select').change(function() {
- pos = $(this).attr("id");
- if (pos == "sector" && $('#sector').val() == 2) {
- $('#TextAreaDiv').fadeIn("slow");
- }
- else {
- $('#TextAreaDiv').fadeOut("slow");
- }
- });
- var i= 0;
- function addField(){
- $('#TextAreaDiv').append('<input type="text" name="myinput'+i+'" />');
- i++;
- return false;
- }
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! ;)