make dynamic id element in javascript : I am trying to reference a part in my view with different id elements and in my javascript, i am constructing this id value but my script can't seem to get it.

**HTML**

    <div id="abc"></div>
    <div id="def"></div>
    <div id="ghi"></div>

**JavaScript**

    function (idName, markup) {
        $('#' + idName).prepend(markup);
    };

so basically, I am passing the ID names in the function but it does not seem to work. The markup by the way is being written insite the div as text.