It was a simple textbox like
<input type="text" id="userName" />
On a button click i just wrote like :
and surprisingly it worked.
kindly help me resolve this, wishing for a innovation soon