How to set a default value with $(selector).val()
Hey,
is there any way to set the default value returned by $(selector).val() while the object (text, textarea...) has no value? What I mean is the way something like below:
- $(selector).val().setDefault('myDefaultValue');
Right now the only way is doing some little overcode like:
-
var value = '';
value = $(selector).val();
if (!value) {
value = 'myDefaultValue'
}
Cheers
Andrzej