Adding javascript for counting characters