Would love some help here. I’m sure it’s simple enough, I’m just a bit flummaxed by it.
This script I am working on: http://jsfiddle.net/rVPnu/9/ fails when the selection is greater than 9.
Can someone explain why and how I fix this so if I select 11 it shows 11 divs?
I did notice this line in the code:
// var gh = tee.charAt(tee.length-1); // get the int form id will (fail if GT 9)
Many thanks!!
The issue is
var gh = tee.slice(-1);. It takes the last character of the elements ID, which in the case of the 11th select isnpup10and returns0.If all elements are going to start with npup you could instead do
tee.slice(4).