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

  • Home
  • SEARCH
  • 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 8436557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:12:35+00:00 2026-06-10T07:12:35+00:00

So using the advice I got here , I tried to implement it like

  • 0

So using the advice I got here, I tried to implement it like this:

  1. I created the following kbd.js file:

    function fnRenderKBD(elem, keysToDisplay)
    {
        var delimiter = '';
        var content = '';
        for(var i = 0, length = keysToDisplay.length; i < length; i++) {
            content+= delimiter + '<kbd>' + keysToDisplay[i] + '</kbd>';
            delimiter = '+';
        }
        elem.innerHTML = content;
    }
    (function() {
            var keys = [ 'Ctrl+X','Y','Z'];   
            var elem = document.getElementById('display');
            fnRenderKBD(elem, keys);
        }
    )();
    
  2. Then I created the following stylesheet, called kbd.css:

    kbd {
        padding: 0.1em 0.6em;
        border: 1px solid #CCC;
        font-size: 11px;
        font-family: Arial,Helvetica,sans-serif;
        background-color: #F7F7F7;
        color: #333;
        -moz-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 2px #ffffff inset;
        -webkit-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 2px white inset;
        box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 2px white inset;
        -moz-border-radius: 3px;
        -webkit-border-radius: 3px;
        border-radius: 3px;
        display: inline-block;
        margin: 0 0.1em;
        text-shadow: 0 1px 0 white;
        line-height: 1.4;
        white-space: nowrap;
    }​
    
  3. Then, I tried to construct a simple HTML file to check the results, called keyboard-rendering.htm

    <script src="kbd.js"> </script>
    <LINK REL=StyleSheet HREF="kbd.css" TYPE="text/css">​
    <div id="display"></div>​
    

My question is, why does this not work (output is “​”), that is, why does it not give me the same output as the lower right quadrant here.

  • 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-06-10T07:12:36+00:00Added an answer on June 10, 2026 at 7:12 am

    Maybe follow this:

    window.onload = function() {
    
        var keys = [ 'Ctrl+X','Y','Z'];   
        var elem = document.getElementById('display');
    
        fnRenderKBD(elem, keys);
    };
    

    and check your page’s charset:

    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a problem using deploy:deploy-file with snapshots I'd like some advice on please.
I would like to have an advice for this issue: I am using Jbos
Our company is currently using a simple trunk/release/hotfixes branching model and would like advice
Asking this question here because in CakePHP google group got no answer.I have the
I found this link where I got this code: $(document).ready(function(){ //when a link in
I'm listing just the file basenames with an ls command like this, which I
A customer has got this error with my software using Python 2.5.5. How can
I need advice on using stored procedures with Entity Framwork 4.x to return data
after some advice regarding a problem i am getting using a linux based piece
I need some advice from experts :) I will develop a website using PHP

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.