jquery - How to add html <br> tags into javascript -


i have button when clicked opens email , fills body variables. looks messy though appears on 1 line. chuck in br tag inbetween each variable appear on new line?

thanks. here code:

$("#buttonlink").click (function() {             window.open('mailto:sales@beauxcadeaux.co.uk?subject=my frame&body=my frame type: ' + frametype + ' frame background: ' + framebackground + ' text: ' + yourtext + ' text design: ' + textdesign);          }); 

i'm thinking like:

$("#buttonlink").click (function() {         window.open('mailto:sales@beauxcadeaux.co.uk?subject=my frame&body=my frame type: ' + frametype + <br> + ' frame background: ' + framebackground + <br> + ' text: ' + yourtext + <br> +' text design: ' + textdesign);      });  

use ascii code %0d%0a, this:

window.open('mailto:sales@beauxcadeaux.co.uk?subject=my frame&body=my frame type: ' + frametype +'%0d%0a frame background: ' + framebackground + '%0d%0a text: ' + yourtext + '%0d%0a text design: ' + textdesign);  

strictly speaking should white spaces replaced. use ascii code %20, this:

window.open('mailto:sales@beauxcadeaux.co.uk?subject=my%20frame&body=my%20frame%20type:%20' + frametype +'%0d%0a%20my%20frame%20background:%20' + framebackground + '%0d%0a%20my%20text:%20' + yourtext + '%0d%0a%20my%20text%20design:%20' + textdesign);  

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -