Javascript slice off last character if there are 2 of them
<p>how to cut off second sign if there is a second sign ?? some times id is ....5a and 5b and i need to cut of the 'a' and 'b'</p>

<p>JS</p>

<pre><code>$(".mieszkanie").click(function() {
        var num = this.id.replace(/c_10_0/, "");
        var n = num.length;
        if (n = 2) { 
            [than cut second sign]
        }
        $('.pdf').attr({ 
            href: "img/rzuty/mieszkania/pietro10rzuty/00" + num + ".pdf"
        });
        $('.karta img').attr({ 
            src: "img/rzuty/mieszkania/pietro10rzuty/00" + num + ".png",
            alt: "mieszkanie 00" + num
        });
    });
</code></pre>

<p>HTML</p>

<pre><code>&lt;div id="rzuty10p" class="rzuty"&gt;
            &lt;span id="c_10_01" class="mieszkanie" title=""&gt;&lt;/span&gt;
            &lt;span id="c_10_02" class="mieszkanie" title=""&gt;&lt;/span&gt;
            &lt;span id="c_10_03" class="mieszkanie" title=""&gt;&lt;/span&gt;
            &lt;span id="c_10_04" class="mieszkanie" title=""&gt;&lt;/span&gt;
            &lt;span id="c_10_06" class="mieszkanie" title=""&gt;&lt;/span&gt;
            &lt;span id="c_10_05a" class="mieszkanie" title=""&gt;&lt;/span&gt;
            &lt;span id="c_10_05b" class="mieszkanie" title=""&gt;&lt;/span&gt;
        &lt;/div&gt;
</code></pre>
