Update grid.js

fixed element selection