I just have write simple script which one change alts in img tag. But it is not working. Here is my script:
jQuery(document).ready(function($) {
var slowakluczowe = ['alt1', 'alt2', 'alt3'];
$("img").attr("alt", function() {
return slowakluczowe[Math.floor(Math.random() * slowakluczowe.length)];
});
});
The script takes random alt
and pins it in to image but this doesn't work well. It doesn't change the alt
when I click 'View Source' it only works when I click 'Inspect Element'.
See here: http://prntscr.com/boo9jk
It's working only with 'Inspect Element' How can I make it also work with 'View Source'?