#anchor doesn't work in IE

#anchor doesn't work in IE

I am using window.location.href to direct my page to an #anchor point on my webpage but it doesn't work within IE. How can I get this working.

  1. window.location.href = '#song4';