A client requested that we have the ability to choose only a month/year in the jQuery UI Datepicker module while retaining the ability to select a specific date. After searching the internet I determined that the best way to do this is just to modify the jQuery UI Datepicker and directly inject a button.
So .text() doesn’t work for retrieving the content. The solution use .html(). The problem with this is that in IE 7/8 you end up with extra white space in the content. The solution $.trim(), and now you have your content the same as modern browsers using .text().
This stumped me long enough while using a value in jQuery’s inArray function and it wasn’t finding the entry, even though I knew that the value existed in the array. Not the most friendly for modern browsers, but maintains backwards compatibility with older version of IE.