How could I find an element with similar ID in JS?
<p>In my page I have labels that look like this:</p>

<pre><code>ContentPlaceHolder1_gvGroups_lblName_0
</code></pre>

<p>with corrosponding:</p>

<pre><code>ContentPlaceHolder1_gvGroups_lblHidden_0
</code></pre>

<p>I can assert that any *lblName has a corrosponding *lblHidden.</p>

<p>Now, I have some js:</p>

<pre><code>//use to make any label with 'edit' class editable
function makeLabelsEditable() {

    $(".edit").focusout(function () {
        setLabel(this);
    });

    $(".edit").click(function () {
        editLabel(this);
    });
}

//used to edit labels
function editLabel(source) {
    source.innerHTML = '&lt;input type="text" maxlength="40" value="' + source.innerHTML + '"/&gt;';
    $(source).unbind('click');
    source.children[0].focus()
}

//used to edit labels
function setLabel(source) {

    if (source.children[0].value != '') {
        $(source).click(function () {
            editLabel(this);
        });
        source.innerHTML = source.children[0].value;
    }

}
</code></pre>

<p>I can assert that anything marked with class edit will be valid.</p>

<p>I need to modify this code like so:
//used to edit labels</p>

<pre><code>function setLabel(source) {

    if (source.children[0].value != '') {
        $(source).click(function () {
            editLabel(this);
        });
        source.innerHTML = source.children[0].value;
        var hidden = someHowGetHiddenFromSource(source);
        hidden.innerHTML = source.children[0].value;
    }

}
</code></pre>

<p>I'm sure this is possible, I just do not know how.</p>

<p>Essentially, it would be something like:</p>

<pre><code>getElementByID(replace(source.id,'lblName','lblHidden'));
</code></pre>

<p>I just do not know what JS / JQ functions can do that.</p>

<p>Thanks</p>
