Select all items of union but not the last one!
- by 100r
I have few texboxes, dropdown lists, etc.. They have their css classes. I want to select all elements of specific class(es) but NOT the last element from group of all classes.
<asp:TextBox ID="TextBox1" runat="server" CssClass="class1" ></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" CssClass="class2" ></asp:TextBox>
<asp:TextBox ID="TextBox3" runat="server" CssClass="class2" ></asp:TextBox>
I want to select only TextBox1 and TextBox2, not TextBox3!
selector should be something like this
$("(.class1,.class1):not(:last)")
or something like
$(".class1,.class1").filter(":not(:last)")
but of course none of it is working :)
any sugestions?
tnx in advance!