BullGuard Antivirus Sale - 60% Off with openElement !
Forum openElement Homepage
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 Reverse Sort Order
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: 05 Juin 2018
Location: Canada, Québec
Status: Offline
Points: 5779
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hobby001 Quote  Post ReplyReply Direct Link To This Post Topic: javascript image src undefined
    Posted: 28 Jan 2021 at 12:23
Here is the code

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


Edited by Hobby001 - 29 Jan 2021 at 02:45
Back to Top
greaseandmetal View Drop Down
Newbie
Newbie


Joined: 27 Jan 2021
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote greaseandmetal Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jan 2021 at 06:26
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 - 28 Jan 2021 at 06:28
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 10.11
Copyright ©2001-2012 Web Wiz Ltd.

This page was generated in 0,031 seconds.