I have this code snippet in JS:

```
var Mylib = Mylib || function(){

    var $cart         = $('#topbar_cart_value');
    var _cartObj = {
        total: 0,
        items: 0
    };    
    /**
     * 
     * @type String|el
     */
    function render() {
        //Render the total in cart
        var str = "&euro;" + str.replace(".",",");
        $cart.html(str); <--
        // THIS IS GETTING SELECTED OK!
        console.log(document.getElementById('topbar_cart_value'));
       // THIS IS GETTING SELECTED OK!
        console.log($('#topbar_cart_value'));
       // BUT THIS IS GETTING SELECTED WITH LENGHT 0! ....
        console.log($cart);
       // ...AND THEN...
        $cart.html(str); //<--DOES NOT SET THE value
    }
return {
        init : function() {
              cacheDom();
            },
            getCartObj : getCartObj,
            setCartObj : setCartObj,  
            addToCartObj: addToCartObj,
    };
}();
Mylib.init(); 
/** ..........AFTER MANY BLOCKS OF HTML AND JS ...............**/

 $(document).ready(function() { unimanlib.init( 
            {'cart_sel':'span#topbar_cart_value'
            }); });

```

The problem is explained in the `render` function.The console for the last log is:

```
[prevObject: m.fn.init[1], context: document, selector: "#topbar_cart_value"]
context: document
length: 0
prevObject:m.fn.init[1]
selector:"#topbar_cart_value"
__proto__: Object[0]

```