How to select all fields in a form with a specific class
I am trying to select all the fields on a form with a specific call name and then select all the others.
my form:
<form style="margin:20px 0" id="myform_2">
<p> Query Name :
<input id="full_text_search" name="name" type="text" class="serialize_1">
</p>
<p> Platform :
<select multiple="multiple" style="width:370px" id="platform" name="platform" class="serialize_1">
<option value="android" selected="selected">Android</option>
<option value="ios">IOS</option>
</select>
</p>
<p> Full Text Search :
<input id="full_text_search" name="full_text_search" type="text">
</p>
<p> Package Name :
<input id="package_name" name="package_name" type="text">
</p>
</form>
I want the first selector to select inputs with class: "serialize_1". so i try this:
$('#myform_2 :input[class==serialize_1"]');
and a second selector to catch everything else, so I try this:
$('#myform_2 :input[class!=serialize_1"]');
what am i missing?
thank
+3
source to share
3 answers