jeudi 28 juillet 2016

HTML - Break Line While Getting Input From TextArea

My Problem Is,

When I Type Multi Lines In TextArea I Get Output Like This,

upper one is input and lower one is output

enter image description here

But I Want To Get Output Like This,

enter image description here

In This Photo I Used <br/> Just For Making The Look What I Want But, In Real I Don't Want To Use <br/> To Break Line In Multi Line

This Is Th Code I'm Using...

<!DOCTYPE html>
<html>
  <head>
  </head>
<body>
  <TextArea id = "Input" onKeyupUp = "showResult()" style = "height: 100px; width: 100%; resize: none;"> </TextArea>
  <Div id = "output" ></Div>
</body>

<script>
  function showResult(){
    var input = document.getElementById("Input").value;
      document.getElementById("Output").innerHTML = input;
  }
</script>
</html>




Aucun commentaire:

Enregistrer un commentaire