You have a missing quote in there, which is causing the browser to misinterpret the ID:
case"101" : strLink = "<li style='cursor:pointer'><a data-scroll><span id='div101'>Form 101</span></a></li>"; $('.sidebar-nav').append(strLink); break;
You also have to make sure to add the handler after the element has been injected into the body. If the element isn't around, it will not register the click event.