How can I change <img>using a prototype JS library? I managed to get the item, but I could not change the "src":
<img>
$('item1').getElementsBySelector('img')
var imgs = $('item1').getElementsBySelector('img'); imgs.each(function(img) { img.src = 'newSrc'; });
You can also use the setAttribute function.
var imgs = $('item1').getElementsBySelector('img'); imgs.each(function(img) { img.setAttribute('src','newSrc'); img.setAttribute('width','100px'); });
Source: https://habr.com/ru/post/1724008/More articles:Webtest with session id in url - asp.netHow to determine if an item is a file or directory using Net :: SFTP? - ruby | fooobar.comКак я могу генерировать xml из иерархии объектов? - javaHaskell Casting - haskellASP.NET Global.asax Application_Error works, but not when using the Error event - c #Why is MFMailComposeViewController not sending messages? - emailHow to save a double file in python? - pythonSQL Server 2008 Filtered Indexes - sqlОшибка выполнения: нарушение прав доступа при использовании .push_back() с помощью std::vector? - c++How to send an email from my application using email? - androidAll Articles