Problem with variable length substring

Problem with variable length substring


Need to retrieve the eventID for the example.
The event ID range length (1 to 4 charachers)
Start at position 12.


  1. var eventID = $(this).text();
    alert(eventID.substring(12, 4)) ;