Create test.js

copied javascript from jsFiddle