I have a small subset of fields that need blanked on a page (so I can’t just run something using :input).
At the moment the code is something like this..
$('#txt1').val('');
$('#txt2').val('');
$('#txt3').val('');
Is it more efficient to chain them or is there some other method entirely I could use?
You can do:
Or:
As can be seen, you can combine multiple selectors by separating them with a comma.
Alternatively you can apply a class to fields you want to clear the text of and use the class in the selector like this:
where your fiels should look like: