1.

What is the use of “defer” attribute?(a) It defers rendering of html page(b) It defers script execution until the page has been rendered(c) It defers rendering of css attributes(d) It is only for internal scriptsI have been asked this question in unit test.Origin of the question is Web Browsers in portion HTML Fundamentals of HTML

Answer»

The CORRECT option is (b) It defers script execution until the PAGE has been rendered

For explanation I WOULD say: The defer attribute is a boolean attribute. The script is executed after the page has finished parsing. The defer attribute is used if and only if there is SRC attribute. Defer is for EXTERNAL not internal scripts.



Discussion

No Comment Found

Related InterviewSolutions