Jump to content

pstein

Members
  • Posts

    130
  • Joined

  • Last visited

Posts posted by pstein

  1. 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

  2. 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

     

×
×
  • Create New...