0

I am trying to get span content with carriage return on key up event but i could not able to achieve it.

I've one text field and div to display what I've typed in text field and I've to save div content with carriage return value.

I've tried an example updating div on text filed key up event when i am typing div content is getting auto wrap but I've no idea who to get div content with carriage return value.

Here is my example http://jsbin.com/UtodICI/1/edit

Ramesh Paul
  • 840
  • 4
  • 15
  • 31
  • I found solution in this link http://stackoverflow.com/questions/4671713/detecting-line-breaks-with-jquery?answertab=active#tab-top – Ramesh Paul Feb 04 '14 at 11:09

1 Answers1

0

Span requires display:block css

Adding CSS

.txt { display:block; border:1px solid red }

will show that your code works and sets the height based on the input ( if the input is a number )

display:block is what is required to change the span to a block element and able to respond to height values.

( if I am correct, this is what you are asking )

Rob Sedgwick
  • 5,216
  • 4
  • 20
  • 36