Class JavaScript<T extends JavaScript<T>>

java.lang.Object
com.oorian.html.Element<T>
com.oorian.html.elements.Script<T>
com.oorian.html.elements.JavaScript<T>
All Implemented Interfaces:
HeadElement

public class JavaScript<T extends JavaScript<T>> extends Script<T>
Represents an HTML script element specifically configured for JavaScript.

This convenience class extends Script and automatically sets the type attribute to "text/javascript" for easier JavaScript inclusion.

JavaScript elements can be used to:

  • Include external JavaScript files via the src attribute
  • Embed inline JavaScript code within the page
  • Add client-side interactivity and dynamic behavior

Note: The ID attribute is excluded as it's typically not needed for script elements.

Since:
1.0
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • JavaScript

      public JavaScript()
      Constructs a new JavaScript element for inline script code. Use Script.setSrcCode(String) or Script.addSrcCode(String) to add the JavaScript code content.
    • JavaScript

      public JavaScript(String src)
      Constructs a new JavaScript element that references an external script file.
      Parameters:
      src - the URL of the external JavaScript file to include