SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2006
    0 Post(s)
    0 Thread(s)

    Select Numbers in Ordered List

    I have some ordered lists on a webpage. When I select the list and copy it, I want the numbers to appear when I paste the content in a textbox. Right now, it just pastes the text without any mark to show a new line.

    How can I include the numbers when I select and copy the list?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Melbourne, AU
    448 Post(s)
    8 Thread(s)
    Are you just copying the text from the browser display? It won't work, because the numbers are not part of the text. They are generated by the browser. To be copyable text, the numbers would have to be in the text itself. E.g. in an UL, you'd have

      <li>1. first</li>
      <li>2. Second</li>
      <li>3. Third</li>
    Then you'd have to style the UL not to include the default dots. Bit of a mess, really.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Madison, WI
    34 Post(s)
    2 Thread(s)
    Actually this is browser dependent, some some browsers copy their out put as plain text some dont.

    A SIMPLER SOLUTION: COPY to a file that RTF format, then convert that to plain text if needed

    As Ralph pointed out the #s ( or bullets in OLs) aren't really part of the content TEXT, and the context of UL/OL doesnt get copied into plaint text, but it does into Rich Text.

    If you are coding and worried about it not retaining the #s you could do something like this:

    ol{list-style: none;   counter-reset:items;}
    li {counter-increment: items}
    li:before {content: counter(items) ". ";}
    	<li>longer sample item</li>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts