SoFunction
Updated on 2025-03-09

js change the src attribute of img tag without response in IE

Today, I encountered a picture that needs to be changed dynamically when writing a project, for example:
<img src="images/" />

Then when changing, use js script:
('checkCodeImage').src='images/‘;

Then it can be changed successfully in Chrome FF, but it cannot be done under IE. I searched online for a long time and roughly understood that this is a bug in IE. If you want to change the src attribute successfully, you can write it like this:
('checkCodeImage').src='images/‘ + Date();

Then, then, then it succeeds. Speechless, small question, remember one,