It is worth analyzing which elements this selector selects and which elements should be selected.
Analyze the selector
:not(img)[alt]
It consists of two parts.
selector : not - selects all elements that do not satisfy the selector, in this case :not(img) selects all elements that are not img
selector by attribute - selects all elements that have a specified attribute, in this case: [alt] selects all elements that have an alt attribute
Together, these selectors will return: all elements are not img , which have an alt attribute
Judging by the markup provided, a sample of all img elements was expected without the alt attribute, this corresponds to the following selector:
img:not([alt])
$('img:not([alt])').attr('alt', 'jQuery');
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <img src='1.ipg' alt='Малюки' title='Малюнки'><br> <img src='2.ipg'><br> <img src='3.ipg'><br> <img src='4.ipg' alt='Малюнки' title='Малюнки'><br>
Do not watch the video, on it, except for the pictures, the alt attribute has also been added to the html, head, body and all other tags
altattribute - Grundy$(document).ready(function() {...}not registered,jquerynot connected - Mr. Black