RE: JavaScript and PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----

8< snip!

> That's incorrect.  A form will function perfectly well with only name=
> attributes, and no ids, and it's quite possible for JavaScript to
> address the form elements using only the names (in fact, it's easier
> than via the ids as there's a short syntax for it!).
> 
> CSS and the DOM, however, use the ids as primary identifier, so use of
> either of those may demand the presence of ids.

8< snip!

True, you can access an input named "myInput" in a form named "myForm"
by simply writing:

	document.myForm.myInput.value = "Hello!";

BUT... for CSS, it's also quite easy to reference something by name:

	[name="myElement"]
	{
		color: blue;
		font-size: 10pt;
	}


Todd Boyd
Web Programmer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux