Share via


targetattribute Attribute

  Microsoft Speech Technologies Homepage

Specifies the property/attribute of the element from which the value is retrieved. Optional.

<value targetattribute = "attribute">

Remarks

The targetelement attribute refers to an element within the current HTML document. The content of the element whose name is specified by the targetelement attribute is inserted into the text to be synthesized. If the content is contained in a property or attribute of the element, the targetattribute attribute specifies that property or attribute on targetelement. If targetattribute is omitted, the value property of the element is used instead. This capability is useful for referring to values in HTML form controls, such as a text box.

Example

The following code demonstrates the use of the targetattribute attribute.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns:salt="http://www.saltforum.org/2002/SALT">
  <head>
    <object id="Speechtags" CLASSID="clsid:DCF68E5B-84A1-4047-98A4-0A72276D19CC" VIEWASTEXT></object>
  </head>

  <body>
    <?import namespace="salt" implementation="#Speechtags" />
      <salt:prompt id="Prompt1">
        You are traveling from 
        <salt:value targetelement="fromCity"  targetattribute="value"/>
        to 
        <salt:value targetelement="toCity"  targetattribute="value"/>
      </salt:prompt>

    <input type="button" name="BtnStart1" value="Start Prompt" OnClick="StartPlayback1()" id="Button1">

    <br><br>
    
    Click <b>Start Prompt</b> to begin speaking the prompt. The names of the <b>From</b> and <b>To</b> cities will be spoken. The cities names may be changed before starting the prompt.

    <br><br>
    From city: <input type="textbox" name="fromCity" value="Seattle" id="fromCity1">

    <br><br>
    To city: <input type="textbox" name="toCity" value="Houston" id="toCity1">

    <script language="JScript">
    <!--
      function StartPlayback1() {
        Prompt1.Start();
      }
    -->
    </script>
  </body>
</html>

See Also

prompt Element |  value Element | targetelement Attribute