Skip to content

Instantly share code, notes, and snippets.

@Pross Pross/snip.js
Created Feb 25, 2016

Embed
What would you like to do?
<script>
!function ($) {
$(document).on( 'ready', function() {
$('img').each(function(e){
var img = $(this)
var alt = img.attr('alt') || false
var src = img.attr('src')
var file = src.substr(src.lastIndexOf('/') + 1)
if( ! alt ) {
img.attr('alt',file)
}
})
})
}(window.jQuery)
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.