a demo using only javascript