Re: How to set the Name of a button by JavaScript





Stefan Mueller wrote:


In whatever way, I don't understand the command 'xelement.id = xelement.name = "MyButton"' with two '=' but it works.

It is simply a shorthand for
xelement.name = 'MyButton';
xelement.id = 'MyButton';
An assignment is an expression that evaluates to the assigned value so you can chain them the way I did.


--

	Martin Honnen
	http://JavaScript.FAQTs.com/
.


Quantcast