To answer the question more broadly (by teaching you how to detect all kinds of client-side capabilities),
have a look here.
Hasan Jafferullah Hoshmin wrote:I want a sample code here pl
And you will have it after you've spent a bit of time learning about this stuff.