In my previous post "Disable Weekends in jQuery DatePicker", I had shown you that how can you disable the weekends in jQuery Datepicker control. However, there could be a situation where you need to enable only weekends and disable all the other days. See below image.
Below given small piece of code fulfill our requirement.
When you run this code, you will see the only weekends are enabled. beforeShowDay option, which takes a function to be called for each date, returning true if the date is allowed or false if it is not.