[Proto-Scripty] Re: How can apply CSS into element created by createElement('div')?
On 2 jul, 07:08, "T.J. Crowder" wrote: > @Maarten: > > > the value you used for your id attribute was 'Window', and identifier > > values are not allowed to start with a capital letter > > Yes they are: "ID and NAME tokens must begin with a letter ([A-Za-z]) > and may be followed by any number of letters, digits ([0-9]), hyphens > ("-"), underscores ("_"), colons (":"), and periods (".")."[2] > > [2]http://www.w3.org/TR/html4/types.html#type-id Ah, thank you, that's the link I was trying to find. > > ...I'm guessing > > 'window' would have worked. > > FWIW, I'd avoid using "window" as an ID. Bound to confuse IE. ;-) For semantic purposes, I wouldn't use 'window' either, aside from possible IE issues. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: How can apply CSS into element created by createElement('div')?
On Jun 30, 4:09 pm, serenobs wrote: > Hi. > > I wrote something like below: > > in CSS > #Window { > background-color: #cc; > border: 1px solid; > > } > > in javascript > var w = document.createElement('div'); > w.id = 'Window'; > > With above code, CSS's property dosen't affect the w element. > What's wrong? > Are you sure there isn't another element with id 'Window' somewhere on the page? That is illegal HTML. Most browsers will accept it, but their behaviour about it is unpredictable. Colin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: How can apply CSS into element created by createElement('div')?
@OP: It's something else about your page, using the ID *does* work.[1] [1] http://pastie.org/531685 @Maarten: > the value you used for your id attribute was 'Window', and identifier > values are not allowed to start with a capital letter Yes they are: "ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".")."[2] [2] http://www.w3.org/TR/html4/types.html#type-id > ...I'm guessing > 'window' would have worked. FWIW, I'd avoid using "window" as an ID. Bound to confuse IE. ;-) -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jul 1, 10:24 am, Maarten wrote: > On 1 jul, 10:56, serenobs wrote: > > > I'm not sure about why id was not working, but anyway it is working > > now using className. :) > > the value you used for your id attribute was 'Window', and identifier > values are not allowed to start with a capital letter, so I'm guessing > 'window' would have worked. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: How can apply CSS into element created by createElement('div')?
On 1 jul, 10:56, serenobs wrote: > I'm not sure about why id was not working, but anyway it is working > now using className. :) the value you used for your id attribute was 'Window', and identifier values are not allowed to start with a capital letter, so I'm guessing 'window' would have worked. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: How can apply CSS into element created by createElement('div')?
Thanks for reply. It worked by using className. I'm not sure about why id was not working, but anyway it is working now using className. :) On 7월1일, 오후4시18분, "T.J. Crowder" wrote: > Hi, > > It should apply to it automatically (assuming you do actually append > that element somewhere after creating it -- you don't show your code > for doing that). > > If you're not seeing the CSS applied correctly and can't immediately > figure out why, I'd recommend picking up with Step #3 from this > troubleshooting list:http://proto-scripty.wikidot.com/faq#xyzprob > > HTH, > -- > T.J. Crowder > tj / crowder software / com > Independent Software Engineer, consulting services available > > On Jun 30, 4:09 pm, serenobs wrote: > > > > > Hi. > > > I wrote something like below: > > > in CSS > > #Window { > > background-color: #cc; > > border: 1px solid; > > > } > > > in javascript > > var w = document.createElement('div'); > > w.id = 'Window'; > > > With above code, CSS's property dosen't affect the w element. > > What's wrong? > > > Thanks in advance.- 원본 텍스트 숨기기 - > > - 원본 텍스트 보기 - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: How can apply CSS into element created by createElement('div')?
Hi, It should apply to it automatically (assuming you do actually append that element somewhere after creating it -- you don't show your code for doing that). If you're not seeing the CSS applied correctly and can't immediately figure out why, I'd recommend picking up with Step #3 from this troubleshooting list: http://proto-scripty.wikidot.com/faq#xyzprob HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 30, 4:09 pm, serenobs wrote: > Hi. > > I wrote something like below: > > in CSS > #Window { > background-color: #cc; > border: 1px solid; > > } > > in javascript > var w = document.createElement('div'); > w.id = 'Window'; > > With above code, CSS's property dosen't affect the w element. > What's wrong? > > Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---