Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6906559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:19:31+00:00 2026-05-27T08:19:31+00:00

Is it possible to customize blinking text cursor in a contenteditable=true div tag? Something

  • 0

Is it possible to customize blinking text cursor in a contenteditable="true" div tag?

Something like getting cursor position and putting a custom cursor on it, or any other trick?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:19:32+00:00Added an answer on May 27, 2026 at 8:19 am

    I agree with Tim, I wouldn’t recommend it either.

    ( unless you have one of Google’s javascript ninjas to help you :p )

    However, here is a sample page with a custom caret used in a <textarea>.. Just to give you an idea of how you can achieve this.

    I beleive this is the most basic implementation of a custom caret.

    <!doctype html>
    <html>
        <head>
            <script type="text/javascript">
    
                var cursor,
                    $ = function (id){
                        return document.getElementById(id);
                    },
                    nl2br = function(txt){
                        return txt.replace(/\n/g, "<br />");
                    },
                    writeit = function(from, e){
                        e = e || window.event;
                        var w = $("writer");
                        var tw = from.value;
                        w.innerHTML = nl2br(tw);
                    },
                    moveIt = function (count, e){
                        e = e || window.event;
                        var keycode = e.keyCode || e.which;
                        if(keycode == 37 && parseInt(cursor.style.left) >= (0-((count-1)*10))){
                            cursor.style.left = parseInt(cursor.style.left) - 10 + "px";
                        } else if(keycode == 39 && (parseInt(cursor.style.left) + 10) <= 0){
                            cursor.style.left = parseInt(cursor.style.left) + 10 + "px";
                        }
    
                    };
    
                window.onload = function (){
                    cursor = $("cursor");               
                    cursor.style.left = "0px";
                };
    
            </script>
    
            <style type="text/css">
                body{margin: 0px;padding: 0px;height: 99%;}
                textarea#setter{left: -1000px;position: absolute;}
                .cursor{font-size: 12px;background-color: red;color: red;position: relative;opacity: 0.5;}
                #terminal{margin: 8px;cursor: text;height: 500px;overflow: auto;}
                #writer{font-family: cursor, courier;font-weight: bold;}
                #getter{margin: 5px;}
            </style>
        </head>
        <body>
        <div id="terminal" onclick="$('setter').focus();">
            <textarea type="text" id="setter" onkeydown="writeit(this, event);moveIt(this.value.length, event)" onkeyup="writeit(this, event)" onkeypress="writeit(this, event);"></textarea>
            <div id="getter">
                <span id="writer"></span><b class="cursor" id="cursor">B</b>
            </div>
        </div>
        </body>
    </html>
    

    Good luck implementing this in a contenteditable.. And I certainly hope this won’t be your next question (:p) !

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know if it's possible to customize each row of listview?
I would like to know how it is possible to customize a NSMenu items
Is it possible to customize ProgressDialog in wxPython? For instance, I would like to
Is it possible to customize the syntax highlighting in Visual Studio 2005? Up to
Is it somehow possible to customize or subclass System.Windows.Forms.ColorDialog to add a few buttons?
Is it possible to customize a django application to have accept localized date format
I am wondering if it is possible to customize Flex Chart to have grids
I was wondering if it is possible to customize the icon used for the
Whether is it possible to get default media player using Javascript, customize play controls
Is it possible to customize the call screen in Android? Example would be, two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.