Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding text nodes #16

Closed
mir3z opened this issue Oct 21, 2014 · 3 comments
Closed

Adding text nodes #16

mir3z opened this issue Oct 21, 2014 · 3 comments

Comments

@mir3z
Copy link

mir3z commented Oct 21, 2014

Is it possible to add text node using HTML.js?

HTML.body.add(document.createTextNode('foo'))
HTML.js:207 Uncaught TypeError: Cannot use 'in' operator to search for 'length' in undefined
@nbubna
Copy link
Owner

nbubna commented Oct 21, 2014

HTML.body.appendChild(document.createTextNode('foo'));

or for lists:

HTML.query('.example').each('appendChild', document.createTextNode('foo'));

That said, i think it'd be better if add() supported non-element nodes. So, leave this open please. I'll fix it as soon as i get a chance. :)

@mir3z
Copy link
Author

mir3z commented Oct 22, 2014

I would definetely like this feature, because I need something like this:

HTML.body.add([document.createTextNode('foo'), document.createTextNode('bar')]

@nbubna
Copy link
Owner

nbubna commented Oct 22, 2014

Ah, multiple text nodes! Yeah, definitely need to add support for that. :)

@nbubna nbubna closed this as completed in 814a03b Oct 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants