SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jun 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    OnClick to select all text in a cell

    Dear ALL

    How to select all text in a cell by clicking in it ?

    I would like to select all text in a cell for fast copying.

    Copying 1 cell at a time.

    Thanks

  2. #2
    SitePoint Wizard GoldFire's Avatar
    Join Date
    Oct 2002
    Location
    Oklahoma City, OK
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If by cell you mean a form element, you could use something like this:

    Code JavaScript:
    function select_all(id) {
        document.getElementById(id).focus();
        document.getElementById(id).select();
    }


Bookmarks

Posting Permissions

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