BullGuard Antivirus Sale - 60% Off with openElement !
Forum Home Forum Home >

openElement

> openElement General Discussion
  New Posts New Posts RSS Feed - javascript image src undefined
  FAQ FAQ  Forum Search   Register Register  Login Login

javascript image src undefined

 Post Reply Post Reply
Author
Message
greaseandmetal View Drop Down
Newbie
Newbie


Joined: Jan 27 2021
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote greaseandmetal Quote  Post ReplyReply Direct Link To This Post Topic: javascript image src undefined
    Posted: Jan 28 2021 at 5:26am
WEitemmouseover is of type WEImage.
it's src attribute is undefined.

var mo = document.getElementById("WEitemmouseover");
console.log(mo.src);

logs "undefined"

console.log(mo.innerHTML) returns:


<div class="OESZ OESZ_DivContent OESZG_WEitemmouseover">
          <img src="../WEFiles/Image/WEImage/menulines_itemsel2-WEitemmouseover.png" class="OESZ OESZ_Img OESZG_WEitemmouseover" alt="">
         </div>

I see the <img> itself has no ID. How am I suppose to access the source?


Edited by greaseandmetal - Jan 28 2021 at 5:28am
Back to Top
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: Jun 05 2018
Location: Canada, Québec
Status: Offline
Points: 6195
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hobby001 Quote  Post ReplyReply Direct Link To This Post Posted: Jan 28 2021 at 11:23am
Here is the code

	console.log($('#WEitemmouseover img').attr('src'));


Edited by Hobby001 - Jan 29 2021 at 1:45am
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.