"BlackBerry 10" and "BlackBerry 7, 6, and older" are different platforms.
HTML5/JavaScript applications can be compatible between BB 10 and older BB devices. But it is source code compatibility, it is not binary code compatibility.
You will need at least two compiled versions of your HTML5/JavaScript. One - for BB10, another for BB7 and older devices.
Get WebWorks for BB7 and older devices here:
http://developer.blackberry.com/html5/download/#smartphones
WebWorks for BB10 is available here:
http://developer.blackberry.com/html5/download/#blackberry10