Page 1 of 1

Javascript Events

Posted: Thu Mar 08, 2018 7:38 pm
by nerdtech
Hey, I am trying to alter the z-index of an object via the javascript event onmouseover but can't get it to work... this is the code I have used:

Code: Select all

document.getElementById("wb_azure_large").style.zIndex = "1";
The "wb_azure_large" is the ID of an image... I have also tried "azure_large" which also doesn't work. In the browsers console I get the message:

Code: Select all

SyntaxError: expected expression, got '}'


What is the correct syntax to use?..

thanks.

Re: Javascript Events

Posted: Thu Mar 08, 2018 9:17 pm
by Pablo
I think the problem is with the quotes:
document.getElementById('wb_azure_large').style.zIndex = '1';

Re: Javascript Events

Posted: Thu Mar 08, 2018 9:34 pm
by pajadt
Ok now have solution

Re: Javascript Events

Posted: Thu Mar 08, 2018 9:34 pm
by nerdtech
Thanks Pablo it now works.