pstein
-
Posts
130 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by pstein
-
-
input textarea
or as HTML:
<textarea ...>
...
</textarea>
-
Assume in multiple textareas appear some source code text whose number of lines varies from textarea to textarea.
Is there a CSS style which I can attach to such a textarea and which tells the browser:
"make textarea automatically big (height) enough to show ALL lines in textarea + 1 blank line at the end but NOT bigger/heigher/more rows than necessary?
If this is not possible with CSS then at least is there a javascript command which let me calculate the number (and assign the "row" parameter to the textarea?
If lines are longer then current textarea width/columns then these lines should be wrapped.
Peter
-
I wanted to replace on a given webpage ALL empty paragraphs
<p></p>
or (mind the blank!)
<p> </p>
by nothing. Therefore I coded:
var div = document.getElementById("foobar");
div.innerHTML = div.innerHTML.replace("<p></p>","");
....but it doesn't work.
What do I have to change?
Furthermore I guess only the first occurence is changed. How do I replace ALL occurencies?
Thank you
Peter
RegExp: replacing ONLY blank lines at the beginning of text?
in JavaScript
Posted
Assume I have a text consisting of multiple (many) lines (e.g. in a textarea).
I want to eleminate all blank lines but only those at the beginning o the text.
How do I specify the corresponding regular expression?
.......replace(/s*n/g,"");
replaces ALL blank lines (even if they are later embedded in text).
Peter