Captured text in javascript