Web domain - 318Part IIIDocument Objects ReferencesetAttributeNS( namespaceURI , qualifiedName , value ) Returns:Nothing. Compatibility:WinIE-,
318Part IIIDocument Objects ReferencesetAttributeNS( namespaceURI , qualifiedName , value ) Returns:Nothing. Compatibility:WinIE-, MacIE-, NN6+, Moz1+, Safari- This method inserts or replaces an attribute in the current element, as specified in the threeparameters. The first parameter of the method is a URI string matching a URI assigned to alabel in the document. The second parameter is the local name portion of the attribute whosevalue you are getting. If a match is found among these parameters, the value in the thirdparameter is assigned to the existing attribute; otherwise, the value is inserted as a newattribute. Related Items:attributes, namespaceURI, localNameproperties; removeAttributeNS(), getAttributeNS(), and setAttributeNodeNS()methods. setCapture(containerBoolean) (See releaseCapture()) setExpression( propertyName , expression ,[ language ]) Returns:Nothing. Compatibility:WinIE5+, MacIE-, NN-, Moz-, Safari- Use the setExpression()method to assign the result of an executable expression to thevalue of an element object property. This method can assign values to both HTML elementobjects and style objects that belong to them. The setExpression()method is a scripted way of assigning expressions to attributes. Butyou can also assign expressions directly to stylesheet definitions in the HTML tag of an ele- ment using the expression()syntax, as in the following example:
The setExpression()method requires three parameters. The first parameter is the name ofthe property (in string form) to which you assign the expression. Property names are case- sensitive. The second parameter is a string form of the expression to be evaluated to supply avalue for the property. Expressions can refer to global variables or properties of other objectsin the same document (provided the property is anything other than an array). An expressionmay also contain math operators. Pay close attention to the data type of the evaluated value of the expression. The value mustbe a valid data type for the property. For example, the URL of the body background imagemust be a string. But for numeric values, you can generally use number and string types inter- changeably because the values are converted to the proper type for the property. Even forexpressions that evaluate to numbers, encase the expression inside quotes. It may not benecessary in all cases, but if you get into the habit of using quotes, you ll have fewer prob- lems for strings or complex expressions that require them. You are not limited to using JavaScript as the language for the expression because you can alsospecify the scripting language of the expression in the optional third parameter. Acceptableparameter values for the language areJScriptJavaScriptVBScriptFor all intents and purposes, JScript and JavaScript are the same. Both languages are ECMA- 262 compatible. JScriptis the default value for the languageparameter. elementObject.setAttributeNS()