473,405 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

[CSS|JS] questions

>> Why is it that sometimes you must use inline styles? (I have tried
doing it in may different ways)

Do a google search on "css specficity", but that's outside the scope of this group.
Matt Kruse wrote:
css specificity ...

I wonder to which extent I could have conflicting CSS rules, since in
my trials I used both classes and id selectors and found the same
behavior. Also I post here in this group too, because JS and CSS do not
always play well together when you dynamically play setting/(re)-/(un)-
CSS properties with JS
..
Here are the two examples, one with inline styles and the other with a
CSS.
..
// __ this one works!
http://www.geocities.com/tekmonk2005...02_inline.html
..
// __ this other one, based on CSS-based styles, does NOT!
http://www.geocities.com/tekmonk2005/example04_css.html
..
Both pages validated (except for the unfinished form, which I complete
dynamically and whose "action" you don't really need in this case)
..
I need to understand this prob and fix it because I don't see any
benefit in using inline styles
..
Also:
..
How can you work around the "end tag for "..." which is not finished."
types of errors?
..
The form element I need only in order to format the pop up and to use
the id selector, in order to feed it in with. I need to complete the
forms dynamically because I work on multilang sites
..
Also there are ways to dynamically insert elements in a select box via
"new Option(...)". How can you do the same thing with radio button or
check boxes options in a form?
..
otf js css

Apr 30 '06 #1
3 1342
onetitfemme said the following on 4/30/2006 2:20 PM:
Why is it that sometimes you must use inline styles? (I have tried
doing it in may different ways) Do a google search on "css specficity", but that's outside the scope of this group.
Matt Kruse wrote:
css specificity ...

I wonder to which extent I could have conflicting CSS rules, since in
my trials I used both classes and id selectors and found the same
behavior. Also I post here in this group too, because JS and CSS do not
always play well together when you dynamically play setting/(re)-/(un)-
CSS properties with JS
..
Here are the two examples, one with inline styles and the other with a
CSS.
..
// __ this one works!
http://www.geocities.com/tekmonk2005...02_inline.html
..
// __ this other one, based on CSS-based styles, does NOT!
http://www.geocities.com/tekmonk2005/example04_css.html
..
Both pages validated (except for the unfinished form, which I complete
dynamically and whose "action" you don't really need in this case)


If you complete it dynamically then completely create it dynamically.
But, you shouldn't say it validated, you should say "It validated before
I put it on Geocities".
..
I need to understand this prob and fix it because I don't see any
benefit in using inline styles
Then don't if you don't understand them.
Also:
..
How can you work around the "end tag for "..." which is not finished."
types of errors?
End the tag, no more "end tag...." errors.
The form element I need only in order to format the pop up and to use
the id selector, in order to feed it in with. I need to complete the
forms dynamically because I work on multilang sites
Then create the form dynamically as well.

myForm = document.createElement('form')
..
Also there are ways to dynamically insert elements in a select box via
"new Option(...)". How can you do the same thing with radio button or
check boxes options in a form?


radioInput = document.createElement('input')
radioInput.type = "radio"

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 30 '06 #2
> > The form element I need only in order to format the pop up and to use
the id selector, in order to feed it in with. I need to complete the
forms dynamically because I work on multilang sites
Then create the form dynamically as well. myForm = document.createElement('form') ..
You know when I code JS I expect for things not to work ;-). I wonder
how cross browser these (to me) naively looking statements are. (new
Option(...)) statements are DOM 0 so they will probably work flawlessly
in all browsers, but I wonder if the same applies to check boxes and
radio buttons.
.. ..
Also there are ways to dynamically insert elements in a select box via
"new Option(...)". How can you do the same thing with radio button or
check boxes options in a form?

radioInput = document.createElement('input')
radioInput.type = "radio"

..
Thanks and let me test this in all browsers I need to test this web
app.
..
onetitfemme

Apr 30 '06 #3
onetitfemme said the following on 4/30/2006 7:13 PM:
The form element I need only in order to format the pop up and to use
the id selector, in order to feed it in with. I need to complete the
forms dynamically because I work on multilang sites

Then create the form dynamically as well.

myForm = document.createElement('form')

..
You know when I code JS I expect for things not to work ;-). I wonder
how cross browser these (to me) naively looking statements are. (new
Option(...)) statements are DOM 0 so they will probably work flawlessly
in all browsers, but I wonder if the same applies to check boxes and
radio buttons.


ISTR a browser that had problems with new Option. I don't remember the
browser and I don't remember the problem to be honest. But, if a browser
doesn't support createElement then it is sufficiently broken/old enough
not to worry with it.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Rhino | last post by:
How hard (and desireable) would it be to give the user certain choices when it comes to printing web pages? The pages on my site use colours and pictures and contain an imbedded menu, among...
3
by: onetitfemme | last post by:
>> Why is it that sometimes you must use inline styles? (I have tried >> doing it in may different ways) > Do a google search on "css specficity", but that's outside the scope of this group. >...
53
by: brave1979 | last post by:
Please check out my javascript library that allows you to create any layout for your web page, nested as deep as you like, adjusting to width and height of a browser window. You just describe it in...
1
by: dustylane | last post by:
I know very little about HTML and CSS but I've been able to decipher most of what I've needed to know based on trial and error. I had a friend coding me a website long ago and he abandoned the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.