Hi Nirbhay,
GridView is a server side control and JavaScript doesn't know anything about GridView. Moreover GridView is rendered as a table element in the browser. So you should be ideally searching for table element in JavaScript.
Use
document.getElementById('gv1')
method of JavaScript to find the table element.