var filterMinPV = $('.hidePVVol > td input:first').val();
var filterMaxPV = $('.hidePVVol > td input:last').val();
Currently they are set to an empty string if the input box is empty. I log these values currently with console.log.
Is it possible to give these values the value of “NULL”, the only way I can see of doing this is possibly putting the if statement inside of the val(). But is there a better way perhaps some chaining function I am missing?
So if the input box has a value I want it assigned to the var. If it is an empty string I want “NULL” assigned to the var.
Hope I explained that well enough!
Not that it helps anything as you still need to test for
nullsomewhere and you might as well test for the empty string instead.You might wanna avoid querying the same element sets for this complex selector twice by: