Home > Article > Web Front-end > The solution to the problem that js changes the src attribute of the img tag but does not respond in IE_javascript skills
When I was writing a project today, I encountered an image that needed to be changed dynamically, for example:
Then when changing, use a js script:
document.getElementById('checkCodeImage').src='images /image02.jpg';
Then it can be changed successfully in Chrome FF, but not in IE. After searching online for a long time, I roughly understand that this is a bug of IE. If you want to change the src attribute Successfully, you can write like this:
document.getElementById('checkCodeImage').src='images/image02.jpg' Date();
Then, and then, and then it succeeds. Speechless, small question, remember one,