0

Can't we use "src" attribute in body tag

Example is given in the <head> tag

23rd Nov 2018, 4:00 PM
Sudarshan Saxena
Sudarshan Saxena - avatar
6 odpowiedzi
+ 4
'src' is not a valid html attribute for <body> tag/element... So, technically you can set it in a <body> tag, but your code will not be valid (even if browsers will silently ignore it), and if you try to access it trough JS code, you will get 'undefined' as value ^^
23rd Nov 2018, 4:50 PM
visph
visph - avatar
+ 1
I think It's not possible to use src attribute in body tag!!
23rd Nov 2018, 4:11 PM
AL Araf
AL Araf - avatar
+ 1
Can you give an example as a code??😊
23rd Nov 2018, 4:27 PM
AL Araf
AL Araf - avatar
+ 1
I didn't see any src attribute in body tag in the code!!
23rd Nov 2018, 4:37 PM
AL Araf
AL Araf - avatar
0
It is bro! We can use it anywhere (body or head) as needed
23rd Nov 2018, 4:13 PM
Sudarshan Saxena
Sudarshan Saxena - avatar
23rd Nov 2018, 4:32 PM
Sudarshan Saxena
Sudarshan Saxena - avatar