0

Can you use javascript functions to return values to use in HTML?

I can’t really explain, so I attached a code https://code.sololearn.com/Wv9VORvMZyJW/?ref=app

21st Feb 2021, 1:24 AM
madeline
madeline - avatar
2 Answers
+ 3
https://code.sololearn.com/W84sj58fnaOn/?ref=app you need to use 'onload' event (directly on img tag)... however, you could do it by css: style="width:100vw;height:100vh;" or through css background image on another element if you want to preserve aspect ratio ;)
21st Feb 2021, 1:38 AM
visph
visph - avatar
0
thank you, just what i was looking for
21st Feb 2021, 1:39 AM
madeline
madeline - avatar