Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery - exclude inputs with certain value from selector

I would like to select all inputs in my div and set them new value but also I want to exclude inputs with certain value something like this:

$('#mydiv input:not(val("100")').val(myvariable);

how to do that, is it possible in simple selector? thanks

like image 326
simPod Avatar asked Dec 10 '22 09:12

simPod


1 Answers

You need to use the attribute not equal selector.

$('#mydiv input[value!="100"]').val(myvariable);

jsFiddle

like image 55
lonesomeday Avatar answered Dec 14 '22 23:12

lonesomeday