user2217565
user2217565

Reputation: 1

Instead of Document.all, what can I use?

I'm calling a javascript for my Gridview, but it seems like document.all does not work in Chrome/Firefox.

What can I replace this with? Thank you

<script type="text/javascript">
    GridViewHelper.Init(document.all.GridView1, 100, 0);
</script>

Upvotes: 0

Views: 5378

Answers (1)

Quentin
Quentin

Reputation: 944202

document.getElementById is the usual choice (the element needs an id).

There are plenty of other options though, including the new, shiny and less well supported document.querySelector.

Upvotes: 4

Related Questions