The JavaScript for Example #1