Commands in Javascript code are overwritten by the last one
<p>I have stacked with my javascript code. In my app I am also using jQuery for faster writing some of the parts.</p>

<p>The thing is that after adding functionality to input files only the one added to the last is working. I found that maybe the reason is this same name of function with this same parameters. So to be sure I added to one my function which I want to use and to the other (I mean the first one) alert with simple text.</p>

<p>This is my code:</p>

<pre><code>newRow.innerHTML = "&lt;a href='#' class='editName'&gt;"+ddList.ddElements[ddList.ddEl.id]+'&lt;/a&gt;';
    newRow.innerHTML += ' X:&lt;input type="text" id="x'+ddList.ddEl.id+'" name="x'+ddList.ddEl.id+'" size=3 value=0&gt;';
    var xField = document.getElementById('x'+ddList.ddEl.id);
    xField.relatedElement = newRow;
    newRow.innerHTML += ' Y:&lt;input type="text" id="y'+ddList.ddEl.id+'" name="y'+ddList.ddEl.id+'" size=3 value=0&gt;';
    var yField = document.getElementById('y'+ddList.ddEl.id);
    yField.relatedElement = newRow;
    $(xField).blur(function(){alert('Handler for X.blur() called.')});
    $(yField).blur(function(){ddList.setObjectPosition(yField,obj,'y');});
    if(RegExprText.test(ddList.ddEl.id))
    {
        newRow.innerHTML += '&lt;br&gt;Kolor:';
        var element = document.createElement('input');
        element.setAttribute('id', 'c'+ddList.ddEl.id);
        element.setAttribute('name', 'c'+ddList.ddEl.id);
        element.setAttribute('type', 'text');
        element.setAttribute('class', 'color');
        element.setAttribute('size', '6');
        newRow.appendChild(element);
        var myPicker = new jscolor.color(element, {});
        $(element).blur(function(){ddList.setColor(element,obj);});
    }
    var links = newRow.getElementsByTagName('a');
    var editLink = links[links.length-1];
    editLink.relatedElement = newRow;
    $(editLink).click(function(){ddList.deleteObject(obj,newRow);});
</code></pre>

<p>So when I have got only X and Y input fields then only Y is active. When I have got X, Y and colorPicker then only colorPicker works.</p>

<p>Interesting thing is that always is working last line of code - editLink.</p>

<p>And I have been trying to change</p>

<p><code>xField.relatedElement = newRow;</code>
on 
<code>newRow.addChild(xField);</code></p>

<p>It doesn't work either.</p>

<p>Thanks for answers in advance.</p>
