Nov
16

Detecting HTML5 Features in Javascript

How can you detect if your browser supports HTML5 features in javascript?  Here’s how:

function isHTML5CanvasSupported() {
    return (typeof HTMLCanvasElement != 'undefined');
}

function isHTML5VideoSupported() {
    return (typeof HTMLVideoElement != 'undefined');
}

function isHTMLClientSideDBSupported() {
    return (window.openDatabase);
}

Have fun!

Tags: ,

Comments are closed.