On 6/6/2016 12:00 PM, Nicolas Pinault wrote:
Of course, a DIV doesn't contain text: it contains elements, some of which may be text elements, and the .nodeValue of those text elements is the text within the DIV.To my knowledge <div>some text</div>, is correct.
So <div>some text <div>some other text</div></div>, is also correct.
Limited knowledge, I guess.
The HTML syntax you cite is acceptable, but the DIV Element in the DOM does not contain text... it contains text nodes which contain text. See stackoverflow for more details (and to save me typing).
Maybe this can be clarified by saying that a <div> (HTML) can contain text, but if DIV (DOM) cannot.
Cheers!
--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/e4bc9bce-4e7f-ceb2-f2c0-a4e7bb79e71d%40g.nevcal.com.
For more options, visit https://groups.google.com/d/optout.
Le 06/06/2016 à 21:47, Glenn Linderman a écrit :
That's right.On 6/6/2016 12:00 PM, Nicolas Pinault wrote:
Of course, a DIV doesn't contain text: it contains elements, some of which may be text elements, and the .nodeValue of those text elements is the text within the DIV.To my knowledge <div>some text</div>, is correct.
So <div>some text <div>some other text</div></div>, is also correct.
Limited knowledge, I guess.
Thanks for the link.
The HTML syntax you cite is acceptable, but the DIV Element in the DOM does not contain text... it contains text nodes which contain text. See stackoverflow for more details (and to save me typing).
Well, I think you'll have to type again to explain this to many people. Like here and many other places.
Maybe this can be clarified by saying that a <div> (HTML) can contain text, but if DIV (DOM) cannot.
Le 06/06/2016 à 21:56, Nicolas Pinault a écrit :
Le 06/06/2016 à 21:47, Glenn Linderman a écrit :
That's right.On 6/6/2016 12:00 PM, Nicolas Pinault wrote:
Of course, a DIV doesn't contain text: it contains elements, some of which may be text elements, and the .nodeValue of those text elements is the text within the DIV.To my knowledge <div>some text</div>, is correct.
So <div>some text <div>some other text</div></div>, is also correct.
Limited knowledge, I guess.
Thanks for the link.
The HTML syntax you cite is acceptable, but the DIV Element in the DOM does not contain text... it contains text nodes which contain text. See stackoverflow for more details (and to save me typing).
Maybe this can be clarified by saying that a <div> (HTML) can contain text, but if DIV (DOM) cannot.
Glenn,Well, I think you'll have to type again to explain this to many people. Like here and many other places.
Re-reading my last sentence, I'm afraid, it can be misunderstood. Please, be assured, there is no offense.
I am learning by reading many posts, tutorials, examples,etc on the Internet.
Sometimes, it's hard to know if what is written on a page is right or not.
Often, it's hard to find the information I need.
If you haven't yet found caniuse.com you should. It doesn't have all the answers, but the ones it has seem to be pretty accurate.
--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/4a05429a-1908-3aa6-24ef-dc96900365a4%40g.nevcal.com.
Thanks for the link. Very useful.
If you haven't yet found caniuse.com you should. It doesn't have all the answers, but the ones it has seem to be pretty accurate.
--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/4a05429a-1908-3aa6-24ef-dc96900365a4%40g.nevcal.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/f8a25772-dba4-e5ae-004d-048144330bd7%40famillepinault.fr.
From Javascript you can document.createTextNode("my plain text") and then append or insert that node wherever you like (in another element that can contain nodes... a text node cannot contain other text nodes, just text). It will, of course, be affected by the default or specific CSS that applies to the parent element.
Thanks for the link. Very useful.
If you haven't yet found caniuse.com you should. It doesn't have all the answers, but the ones it has seem to be pretty accurate.
--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/4a05429a-1908-3aa6-24ef-dc96900365a4%40g.nevcal.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/f8a25772-dba4-e5ae-004d-048144330bd7%40famillepinault.fr.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/2e948472-d49e-bc07-199b-ffc20c926ff3%40g.nevcal.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/c629171e-3cce-9fea-d076-7b8251154bfc%40famillepinault.fr.
Even <span> can have CSS referencing it to format it in whatever way the CSS specifies... either using ID or CLASS attributes, or element containment selectors that require no particular attributes.Sure but it seems to be the most "generic" tag.
From javascript. But from html ?
From Javascript you can document.createTextNode("my plain text") and then append or insert that node wherever you like (in another element that can contain nodes... a text node cannot contain other text nodes, just text). It will, of course, be affected by the default or specific CSS that applies to the parent element.
I haven't followed all of this thread, so maybe I've missed something, but for raw text, couldn't you use the PRE tag?
--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/6d477987-c0eb-ba76-fa31-14659dc0b126%40g.nevcal.com.