I agree with the concept but I disagree with the implementation. I think this problem is best solved using PHP's header function:

header('Content-disposition: attachment; filename="' . $filename . '"');

This works for all browsers and doesn't require any additional javascript or conditional HTML (I always think it's a bad idea).

Hopefully we can use the download attribute in a couple years when the rest of the browsers get caught up.

http://svarden.se/blog/2013-04-22-right-click-and-save-as/