How to modify the attribute of a container element of jquery in Javascript? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to modify the attribute of a container element of jquery in Javascript?

I have the following HTML: <div id="tem_${temName}" class="tem-item gallery-item" style="display:inline-block"> <img class="nottohide" onerror="this.src='static/common_data/plus.png'" src="" height="150" width="100"> </div> And this jQuery Container: templateList = $('#pose_list'); How can I Manipulate the value of the src attribute of the <img> tag which in itself is nested in the <div> tag

23rd Jun 2020, 12:01 PM
Manan Sharma
Manan Sharma - avatar
1 Answer
+ 1
$("img").src="" or $(".nottohide").src="" or $("div>.nottohide").src="" I am not sure about the last one
23rd Jun 2020, 12:38 PM
Abhay
Abhay - avatar