Javascript class "Object #<HTMLInputElement> has no method 'addTag'"
<p>I've worked with javascript for a long enough time, and this is the first time I've ever been completely stumped as to what is wrong.</p>

<pre><code>Object #&lt;HTMLInputElement&gt; has no method 'addTag'
</code></pre>

<p>So, here is the javascript file.</p>

<pre><code>function actions(){
    var main = this;

    this.addTag = function(){
        var sTag = $('#sTag').val();
        if(sTag!=''){
            var i = $('#tag-list li').length+1;
            var html = '&lt;li id="tag_'+i+'"&gt;';
                html+= '    &lt;input type="hidden" name="sTags" value="'+sTag+'" /&gt;'+sTag;
                html+= '    &lt;a href="#" class="small button delete" title="Remove tag" onclick="act.removeTag('+i+');return false;"&gt;&lt;/a&gt;';
                html+= '&lt;/li&gt;';
            $('#tag-list ul').append(html);
            $('#tag-list').show();
        }
    }
    this.removeTag = function(i){
        $('#tag_'+i).remove();
        if($('#tag-list li').length==0){
            $('#tag-list').hide();
        }
    }
}
</code></pre>

<p>Relatively basic. The javascript file is included in the page like so</p>

<pre><code>&lt;script type="text/javascript" src="scripts.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
    var act = new actions();
&lt;/script&gt;
</code></pre>

<p>Then further down the page in the form, there is a basic system to add a tag to a list</p>

<pre><code>&lt;input type="text" id="sTag" name="sTag" size="30" class="text left" style="margin:5px 4px 0 0;" value="" /&gt;
&lt;a href="#" class="short medium button" onclick="act.addTag();return false;"&gt;&lt;span class="tick"&gt;&lt;/span&gt;Add&lt;/a&gt;
</code></pre>

<p>This is meant to add a new tag to a list, the list is then saved when the form is submitted.</p>

<p>I've only shown relevant parts due to the overall size of the page.</p>

<p>I've used this setup, although with different functions, dozens or hundreds of times before without trouble. I don't think it's a caching issue as the issue exists on different devices and browsers which have never accessed the page before.</p>

<p>Any help is greatly appreciated!</p>
