javascript - How do I input specific tags by calculating the text length which user input in textarea? -


i'm using customed wysiwyg dhtml editor. editor's usable on desktop. want shown on both desktop , mobile. (and needs specific class of tag , tag.) , got me thingking... desktop(mostly laptops) , mobile devices not same. have different pixels~ if i'm using text data not problem. i'm using specific & tags (their width , height must defined in css pixels) need find way put 2 different type of tags(one desktop,one mobile) 1 incoming input(which user input dhtml editor textarea) calculating text input.

ex> .my_div { width: 450px; height: 550px;   } .my_div .my_span { width: 350px; height: 530px;   ex1> <div class="my_div"><span class"my_span">it's when text user input here more height of 530px....close 1 and... </span></div> <div class="my_div"><span class"my_span">...and in put new div , span tags automatically, reapeatedly until press "end" button close </span></div> 

and when ex1> hadeled... want send 2 different text data mysql db. 1 desktop 1 mobile. need of ex1> 1 height of 530px(for desktop) , 1 350px(for mobile)

i'd love take answer whole code but, keyword! or method or related monster thing.... :( i've been 3 day , night bbecause of this! head explode... , every search result i've got ...just showing how 'remove' tags or how input
tag automatically please me~ thank time~

  • height equal font size * number of lines
  • number of lines equal text length / width of textarea
  • text length equal characters + whitespace monospace fonts, not others
  • characters + whitespace returned textcontent/innertext property after trimming

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -