Improved inline JavaScript example