As per WP Code Snippet blog, it looks like this is one way:
Add this code snippet to your functions.php file.
// add async and defer to javascripts
function wcs_defer_javascripts ( $url )
{
if ( FALSE === if (strpos( $url, '.js' ) === FALSE) {
return $url;
}
if ( strpos( $url, 'jquery.js' ) ) {
return $url;
}
return "$url' async onload='myinit()";
}
add_filter( 'clean_url', 'wcs_defer_javascripts', 11, 1 );