html page working fine in jsfiddle but not in local file

html page working fine in jsfiddle but not in local file

Hi to all,

I have html page and i use jquery,javascript and css codes.
For testing,i run it in jsfiddle and its working perfectly but when i used it my application then its not working.
I do not find any error in the console too.

Here is the link to jsfiddle
http://jsfiddle.net/YPBts/2/

and here is my code











  1. <!doctype html>  
  2.   
  3. <html lang="en">  
  4. <head>  
  5. <meta charset="utf-8" />  
  6. <title>jQuery UI Autocomplete - Multiple values</title>  
  7. <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />  
  8. <script src="http://code.jquery.com/jquery-1.9.1.js"></script>  
  9. <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>  
  10. <link rel="stylesheet" href="/resources/demos/style.css" />  
  11. <script>  
  12. $('#mylist').change(function () {  
  13.     var x = document.getElementById("mylist").value;  
  14.   
  15.     if (x == "firstname") {  
  16.         var availableTags = [  
  17.             "ActionScript",  
  18.             "AppleScript",  
  19.             "Asp",  
  20.             "BASIC",  
  21.             "C",  
  22.             "C++",  
  23.             "Clojure",  
  24.             "COBOL",  
  25.             "ColdFusion",  
  26.             "Erlang",  
  27.             "Fortran",  
  28.             "Groovy",  
  29.             "Haskell",  
  30.             "Java",  
  31.             "JavaScript",  
  32.             "Lisp",  
  33.             "Perl",  
  34.             "PHP",  
  35.             "Python",  
  36.             "Ruby",  
  37.             "Scala",  
  38.             "Scheme"];  
  39.         $("#tags").autocomplete({  
  40.             source: availableTags  
  41.         });  
  42.   
  43.   
  44.     } else if (x == "lastname") {  
  45.         var availableTags = [  
  46.             "ActionScript",  
  47.             "AppleScript",  
  48.             "Asp",  
  49.             "BASIC",  
  50.             "C",  
  51.             "C++",  
  52.             "Clojure",  
  53.             "COBOL",  
  54.             "ColdFusion",  
  55.             "Erlang",  
  56.             "Fortran",  
  57.             "Groovy",  
  58.             "Haskell",  
  59.             "Java",  
  60.             "JavaScript",  
  61.             "Lisp",  
  62.             "Perl",  
  63.             "PHP",  
  64.             "Python",  
  65.             "Ruby",  
  66.             "Scala",  
  67.             "Scheme"];  
  68.         $("#tags").autocomplete({  
  69.             source: availableTags  
  70.         });  
  71.     }  
  72. });  
  73.   
  74.   
  75.   
  76. </script>  
  77. </head>  
  78. <body>  
  79. <select id="mylist">  
  80.     <option value="">Select one</option>  
  81.     <option value="firstname">firstname</option>  
  82.     <option value="lastname">lastname</option>  
  83.     <option value="fullname">fullname</option>  
  84. </select>  
  85. <div class="ui-widget">  
  86.     <label for="tags">Tags:</label>  
  87.     <input id="tags" />  
  88. </div>  
  89. </body>  
  90. </html> 


Can Any body please point the error where i make?