There is a form submit button:
<input type="submit" onclick="ProfileEditor.saveWork(this)" value="Сохранить"> as well as its handler:
saveWork: function(btn){ alert('dd'); return false; }, When clicking, the alert is displayed properly, but then the standard form is submitted. So return false is not affected. What can be done?
attachEventthisis awindow, currentTarget is also absent, unlike onclick. Global variables are not an argument, then you can say that every answer you have is an appeal to $ / jQuery, because they are global objects. Via onclick, it is convenient to pass options, with a declarative approach (this is more convenient than data- *, which lose typing). Here is another example<img src="/fail.png" onerror="this.src = '/placeholder.png';"/>. I honestly don’t understand why you took my answer so badly. - RubaXa