SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Guru
    Join Date
    Oct 2001
    Location
    USA
    Posts
    760
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to display blinking curosor in a div

    Is it possible to show a blinking cursor where someone clicks in a div just like it would normally behave in a textarea?

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not with HTML. You might fake something with JavaScript, perhaps.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Guru
    Join Date
    Oct 2001
    Location
    USA
    Posts
    760
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can we move this question?

    How does tinymce do it?

  4. #4
    SitePoint Enthusiast
    Join Date
    Sep 2008
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    works in IE:

    <div contentEditable="true">test</div>
    Teun Hoogendoorn
    ATSC
    LinkedIn
    Blog

  5. #5
    SitePoint Guru
    Join Date
    Oct 2001
    Location
    USA
    Posts
    760
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is pretty cool... is there anything that is cross browser compatible?

  6. #6
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by 321web View Post
    That is pretty cool... is there anything that is cross browser compatible?
    http://forums.asp.net/p/1325888/2647153.aspx
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  7. #7
    SitePoint Enthusiast
    Join Date
    Sep 2008
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by 321web View Post
    That is pretty cool... is there anything that is cross browser compatible?
    It also works in FireFox 3 (FireFox 2 does not support this AFAIK) and Google Chrome (I have no other browsers installed), but real cross-browser is another story...
    Teun Hoogendoorn
    ATSC
    LinkedIn
    Blog

  8. #8
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It works in Opera, too (although you may need to click on the element before the cursor becomes visible).

    This isn't HTML, though, since contentEditable isn't declared in any official HTML DTD.
    Birnam wood is come to Dunsinane


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
  •