TextArea Placeholder Lines

Support General TextArea Placeholder LinesResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26554
    Maria O.Maria O.
    Participant

    Hi!

    Is there a way to write the placeholder of the "textarea field" in two or more lines? I mean, I write some words in one line, press like "enter" and write another words in other line.

    Thanks in advance.

    #26561
    Long NguyenLong Nguyen
    Moderator

    Hi Maria,

    Please follow this topic on StackOverFlow to get multi-lines for textarea placeholder https://stackoverflow.com/questions/7189223/can-you-have-multiline-html5-placeholder-text-in-a-textarea

    JS

    var textAreas = document.getElementsByTagName('textarea');
    
    Array.prototype.forEach.call(textAreas, function(elem) {
        elem.placeholder = elem.placeholder.replace(/\\n/g, '\n');
    });

    Placeholder text: Hello, \nThis is multiline example \n\nHave Fun

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.