How do I select all inputs in a form but not of type button, unless the button has the class called, say, 'preview'?
I started writing
input:not([type="button"]), input.preview
and then wondered if it was appropriate. The first part of the selector selects all non-button inputs while the second part should select
buttons with a 'preview' class. Will the first part discount the second?
Andrew Poulos <ap_prog@hotmail.com> wrote on 15 Dec 2020 in comp.infosystems.www.authoring.stylesheets:
How do I select all inputs in a form but not of type button, unless the
button has the class called, say, 'preview'?
I started writing
input:not([type="button"]), input.preview
and then wondered if it was appropriate. The first part of the selector
selects all non-button inputs while the second part should select
buttons with a 'preview' class. Will the first part discount the second?
What do you mean by "appropriate", if your mother-in-law will concur? Discounts only in your mother-in-law's delicatessen!
The proof surely is in the eating.
<style>
input {background:yellow;}
input:not([type="button"]), input.preview {background:navy;}
</style>
<input type='button'>
<input type='button'>
<input type='button'>
<input type='button' class='preview'>
<input class='preview'>
On 16/12/2020 3:17 am, Evertjan. wrote:
Andrew Poulos <ap_prog@hotmail.com> wrote on 15 Dec 2020 in
comp.infosystems.www.authoring.stylesheets:
How do I select all inputs in a form but not of type button, unless the
button has the class called, say, 'preview'?
I started writing
input:not([type="button"]), input.preview
and then wondered if it was appropriate. The first part of the selector
selects all non-button inputs while the second part should select
buttons with a 'preview' class. Will the first part discount the second?
What do you mean by "appropriate", if your mother-in-law will concur?
Discounts only in your mother-in-law's delicatessen!
By "appropriate" I meant that it does what I am expecting/hoping it will
and have behave counter intuitively (have the expected action discounted).
The proof surely is in the eating.
<style>
input {background:yellow;}
input:not([type="button"]), input.preview {background:navy;}
</style>
<input type='button'>
<input type='button'>
<input type='button'>
<input type='button' class='preview'>
<input class='preview'>
Thanks, I ran your example and the selector works.
By "appropriate" I meant that it does what I am expecting/hoping it will
and have behave counter intuitively (have the expected action discounted).
Appropriate means, imho, 'working' + 'socially correct',
I don't think intuition has much to do with it.
How do I select all inputs in a form but not of type button, unless the button has the class called, say, 'preview'?
I started writing
input:not([type="button"]), input.preview
and then wondered if it was appropriate. The first part of the selector selects all non-button inputs while the second part should select
buttons with a 'preview' class. Will the first part discount the second?
In article <27ednUz4JfKqq0XCnZ2dnUU7-I_NnZ2d@westnet.com.au>,
Andrew Poulos <ap_prog@hotmail.com> wrote:
How do I select all inputs in a form but not of type button, unless the
button has the class called, say, 'preview'?
I started writing
input:not([type="button"]), input.preview
and then wondered if it was appropriate. The first part of the selector
selects all non-button inputs while the second part should select
buttons with a 'preview' class. Will the first part discount the second?
No, the two selectors are treated independently. So the result is the
union of all elements that match either selector.
Basically
selector1, selector2 {
styles;
}
is equivalent to
selector1 {
styles;
}
selector2 {
styles;
}
On 17/12/2020 7:01 am, Barry Margolin wrote:
In article <27ednUz4JfKqq0XCnZ2dnUU7-I_NnZ2d@westnet.com.au>,
Andrew Poulos <ap_prog@hotmail.com> wrote:
input:not([type="button"]), input.preview
No, the two selectors are treated independently. So the result is
the union of all elements that match either selector.
Ah, so the comma acts like an "or".
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 29:21:36 |
Calls: | 6,648 |
Calls today: | 3 |
Files: | 12,193 |
Messages: | 5,328,256 |