<!DOCTYPE html>
<html>
<head>
  <title>Test</title>
  <script id="app1" type="text/javascript">console.log("keep attributes: id, type");</script>
  <script defer="defer">console.log('keep attribute: defer="defer"');</script>
  <script defer>console.log("keep attribute: type: defer");</script>
  <script>console.log("remove all attributes");</script>
</head>
<body>
  <h1>Test</h1>
</body>
</html>