Hi,

I need to indent text of textarea control with either bullets or numbers

How can we achieve this in javascript.

Any help will be greatly appreciated.

Thanks in advance

Why would you use Javascript to do this instead of just using ul/li's in your HTML?

I need to indent text of textarea control with either bullets or numbers

Maybe you just want a scrolling area containing a bulleted list. If so, then try this approach:

<div style="overflow:auto; width:200px; height:70px; border:1px solid; font-size:10pt;">
  <p style="margin:0 0 3px 0; font-weight:bold;">Trees</p>
  <ul style="margin:0 20px; padding:0;">
    <li>Abies Grandis</li>
    <li>Chamaecyparis Obtusa</li>
    <li>Juniperus Communis 'Depressa Aurea'</li>
    <li>Larix Decidua</li>
    <li>Taxus Baccata</li>
    <li>Thuja Plicata</li>
  </ul>
</div>

How can we achieve this in javascript.

No need to use Javascript, just write/build the HTML and serve it in the normal way.

If you need to make the UL/OL dynamic, then use standard DOM scripting to insert/remove/change the LI contents within the list.

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.