Reputation: 19
I am using windows.scrollTo function to scroll to the top of the page in my HTML file . It works fine in Firefox and Chrome but not in IE 10. can anyone help ? ! the code for the function is as follows :
<script type="text/jscript">
function myFunction()
{
window.scrollTo(0, 0);
}
</script>
Upvotes: 0
Views: 122
Reputation: 59232
Remove the type
attribute and you should do fine. You are specifying a wrong type. It should be text/javascript
Javascript has sort of become a standard, that there is no need of type
attribute.
You got away with other browsers, because, I think they are permissive. But IE is very picky about things.
Upvotes: 1
Reputation: 882
You have to use type="text/javascript"
instead of type="text/jscript"
. Then your code should work fine.
<script type="text/javascript">
function myFunction()
{
window.scrollTo(0, 0);
}
Upvotes: 3