Share via


Defines a method of the HTML Component (HTC) to be exposed to the containing document.


    ID = "sID"
    INTERNALNAME = "sInternalName"
    NAME = "sName"/>


  • ID
    Optional. String that uniquely identifies the PUBLIC:METHOD element within the component. This attribute is analogous to the ID attribute in Dynamic HTML (DHTML).
    Optional. String that specifies the name by which the method is referred to within the component. If no value is specified, the NAME attribute is used by default.
  • NAME
    Required. String that specifies the name by which the method is referred to in the containing document. By default, the NAME specified is also used to refer to the method within the component, unless an INTERNALNAME attribute is specified.

Element Information

Parent elements PUBLIC:COMPONENT
Child elements None
Minimum availability Internet Explorer 5
Minimum operating systems Windows 95, Windows NT 4.0


By specifying a NAME attribute similar to a standard method name already defined for the element, a behavior can override the element's default behavior.


This example uses the PUBLIC:METHOD tag to expose the startFlying method from the HTC to the containing document.

   <PUBLIC:METHOD NAME="startFlying" />

      function startFlying()
         // Insert flying code here

This example of a containing document demonstrates one way to call the method.

         .FLY   {behavior:url(}

   <BODY ID="flyingHigh" class="FLY">
      <DIV onclick="flyingHigh.startFlying()">
         <!-- Insert stuff to fly -->

See Also

Introduction to DHTML Behaviors, Using HTML Components to Implement DHTML Behaviors in Script, PUBLIC:EVENT, PUBLIC:PROPERTY