Why does function only work once?
Having problems that my function only seems to execute once...code:
- <html>
- <head>
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
- <script type="text/javascript" >
- $(document).ready(function(){
-
- $("*[id^=\'ST\']").each(function() {
- $(this).click(function() {
- string = this.id.substring(2);
- string2 = "#" + string;
- $(string2).load('tips/'+this.id+'.txt');
- });
- });
-
-
- });
-
-
- </script>
- </head>
- <body>
- <a id="STtextfield">[+]</a>
- <textarea name="textfield" id="textfield"></textarea>
- </body>
- </html>