Why can't this click event type the opacity value of the element?

Oct.09,2021

you get the inline style


because you do not set
window.getComputedStyle you can get the final calculated style


take a look at the print, but the data is empty, because
< div id= "fade-obj" style= "width:300px;height:300px;background:-sharp000" > < / div >
there is no opacityvalue set in style

because there are only inline styles on obj.style,
you should write

window.getComputedStyle(obj,null).getPropertyValue("opacity")

obj.style gets the declared object key value of the DOM element CSS style.
style can only get the specific value of the inline style, but the internal and external styles cannot get the specific value.
obj.style is readable and writable. When you read obj.style, before writing obj.style in JS code, you will get a null value.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36a40-2ad74.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36a40-2ad74.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?