Return to Snippet

Revision: 5592
at March 18, 2008 05:32 by cczona


Initial Code
<p id="apple">Apple</p>
	<p id="banana">Banana</p>
	<p id="cherry">Cherry</p>
	
	<script type="text/javascript" charset="utf-8">
		// this works
		x=$$('banana').addContent('foo');

		// so does this
		y=$(x.next()).addContent('bar');

		// but this is null, because this object doesn't have any DOMAssistant methods e.g. addContent
		z=x.prev().addContent('baz');

	</script>

Initial URL
http://groups.google.com/group/domassistant/browse_thread/thread/f6dbc459c1116a6a

Initial Description
*"Only the elements which are are selected through the $ selector will get the extra DOMAssistant methods added to it."

Initial Title
object methods gotcha with DOMAssistant

Initial Tags
javascript

Initial Language
JavaScript