I have written this in aura as

                             var newline ='';
                             newline +='\n';

but it is not working.

  • 1
    This is not enough detail to identify the problem. Please edit your post to provide a reproducible example and specific description of what is not working.
    – David Reed
    Jan 10 at 16:11

The most literal interpretation in Aura would be:

const myInput = component.find("myInput");
let value = myInput.get("v.value");
value += "\n";
myInput.set("v.value", value);

Where myInput is defined on the component as its aura:id:

<lightning-textarea aura:id="myInput" ...

Feel free to change this as you desire.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.