Added javascript for counting characters