I need to add an initial text in textarea in two lines
and to clear textarea on focus.
I tried to use this code
var startVal = 'Additional info: <br > text text text';
var messBox = $('.textarea-1').val(startVal);
messBox.on('focus blur', function(){
var curVal = $.trim($(this).val());
if(curVal == startVal) {
$(this).val('');
} else if(!curVal){
$(this).val(startVal);
}
});
but it shows <br>
tag inside my text and doesn't migrate the second row on new line.
How to make it work?