async_002.htm (1451B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Changes to the 'async' attribute are reflected in the async property</title> 5 <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 6 <meta description="This test ensures changes to the 'async' attribute are reflected in the async property." /> 7 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 8 <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-async"/> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 </head> 12 <body> 13 <div id=log></div> 14 <script type="text/javascript"> 15 test(function() { 16 var s = document.createElement("script"); 17 s.async = false; 18 s.setAttribute('async', ''); /*Should change s.async to true*/ 19 assert_true(s.async) 20 }, "Test 'async' attribute are reflected in the async property with setAttribute"); 21 22 test(function() { 23 var s = document.createElement("script"); 24 s.async = false; 25 s.setAttribute('async', ''); /*Should change s.async to true*/ 26 s.removeAttribute('async'); /*Should change s.async to false*/ 27 assert_false(s.async) 28 }, "Test 'async' attribute are reflected in the async property with removeAttribute"); 29 </script> 30 </body> 31 </html>