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 6101497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:30:23+00:00 2026-05-23T13:30:23+00:00

I have a JS file CharacterSelection where a user can select an avatar and

  • 0

I have a JS file CharacterSelection where a user can select an avatar and type their name into a textarea.

Now I want to set a text div in an html file to the contents of the textarea. I will use it to display the player’s name at a specific location on the screen.

I know that I can set a div to a text, such as: <div id ="statSheetExitButton">Exit</div> will show “Exit” (style and location depending on css)

I’m wondering if there is any way to put a String variable in there, since I will not know what name the player enters.

I grab the textarea’s contents using var name = $("#nameTextBox").val();

I’m thinking that saying <div id ="playerName">name</div> will display the text “name”.

Is there a way to accomplish my goal?

  • 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-23T13:30:24+00:00Added an answer on May 23, 2026 at 1:30 pm
    $("#nameTextBox").change(function(){
      $("#playerName").html($(this).val());
    });
    

    This will attach an event handler to the textbox so everytime the name changes the div is updated.

    Here is a working example. http://jsfiddle.net/2NkTb/

    Please note that for the onchange event you must tab out of textbox or the textbox must lose focus

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

Sidebar

Related Questions

Problem: I have file named by their Id from database. And when somebody want
I have file paths in one side and their new paths where I want
In the filesystem I have /file.aspx /directory/default.aspx I want to configure IIS so that
I have a variable in code that can have file path or url as
I have a file that I want to include in Python but the included
I have file upload UI element in which the user will upload images. Here
I have file.txt data file in my project which is in resource folder. Now
can anyone help? I have small procedure to read in an UTF-8 file with
I have file about 5.5GB of size. I want to view a particular line
I have file that I need to hash, this file can be too large

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.